summaryrefslogtreecommitdiff
path: root/internal/cli/cli_backend.go
AgeCommit message (Collapse)Author
2026-04-18refactor: extract migration logic into internal/migrate package (task q6)Paul Buetow
Move all geheim→KeePass migration business logic from internal/cli/migrate_kdbx.go into a new internal/migrate package (migrator.go, kdbx_store.go). The CLI layer is now a thin orchestrator: parse flags, open KDBX, call migrate.Run, save, report. Key design decisions: - migrate.Run accepts separate logFn (stdout info) and warnFn (stderr errors) so per-entry errors correctly route to stderr via warn(), not stdout via logMsg() - migrate.Options contains only DryRun; DBPath/BinaryOutDir removed (CLI-only concerns) - StoreWalker interface is narrow, avoiding a direct dependency on backend.Backend - cli_paths.go extracts readPasswordFile/resolveHomeDir/expandHome shared within cli - kdbx_store.go deleted from cli (moved to internal/migrate) - Duplicate TestExtractPasswordFromContent removed from kdbx_store_test.go - Custom contains/containsStr helpers replaced with strings.Contains in tests - Dry-run test now asserts logged message content Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18refactor: move Gitter interface to consumer package internal/cli (task p6)Paul Buetow
Per Go best practice (100 Go Mistakes #6): interfaces belong where they are used, not where they are implemented. Move Gitter from internal/git to internal/cli/git.go. Compile-time assertions (var _ Gitter = ...) kept in the new location. internal/git retains concrete *Git and *NoOp types. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18refactor: split cli.go into focused files by responsibilityPaul Buetow
Extract cli.go into four dedicated files to improve separation of concerns and readability: cli_flags.go (flag parsing), cli_backend.go (backend init), cli_commands.go (command handlers), cli_dispatch.go (command routing). Fix inaccurate comments on logMsg/warn that claimed declaration order matters in Go; package-level functions are resolved across the whole file. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>