summaryrefslogtreecommitdiff
path: root/internal/cli
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cli')
-rw-r--r--internal/cli/cli.go6
-rw-r--r--internal/cli/cli_test.go2
2 files changed, 5 insertions, 3 deletions
diff --git a/internal/cli/cli.go b/internal/cli/cli.go
index 75ab078..1f5a736 100644
--- a/internal/cli/cli.go
+++ b/internal/cli/cli.go
@@ -187,7 +187,9 @@ func newCLI(ctx context.Context, backendName, kdbxPath string) (*CLI, error) {
}
// resolveBackend returns the effective backend name given the flag override and
-// the config value. flag takes precedence; empty strings fall back to "geheim".
+// the config value. flag takes precedence; config value is used next; the
+// last-resort default is "keepass" (matching the config.defaultConfigWithHome
+// default so that the two sources of truth stay in sync).
func resolveBackend(flagValue, cfgValue string) string {
if flagValue != "" {
return flagValue
@@ -195,7 +197,7 @@ func resolveBackend(flagValue, cfgValue string) string {
if cfgValue != "" {
return cfgValue
}
- return "geheim"
+ return "keepass"
}
// buildBackend constructs the Backend and its associated Gitter based on
diff --git a/internal/cli/cli_test.go b/internal/cli/cli_test.go
index 1661283..4b05487 100644
--- a/internal/cli/cli_test.go
+++ b/internal/cli/cli_test.go
@@ -874,7 +874,7 @@ func TestResolveBackend(t *testing.T) {
}{
{name: "flag wins", flagValue: "keepass", cfgValue: "geheim", want: "keepass"},
{name: "config when no flag", flagValue: "", cfgValue: "keepass", want: "keepass"},
- {name: "default when both empty", flagValue: "", cfgValue: "", want: "geheim"},
+ {name: "default when both empty", flagValue: "", cfgValue: "", want: "keepass"},
{name: "flag overrides empty config", flagValue: "geheim", cfgValue: "", want: "geheim"},
}