| Age | Commit message (Collapse) | Author |
|
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>
|
|
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>
|
|
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>
|