lockbox

password manager
Log | Files | Refs | README | LICENSE

commit f497e873e169b37e9456f4fcbb6c889212189325
parent 9ea2cbe38d3579a60abc9d0dad5d7dbe049d681b
Author: Sean Enck <sean@ttypty.com>
Date:   Sat,  7 Dec 2024 11:09:40 -0500

eliminate an unused var

Diffstat:
Minternal/app/core.go | 1-
Minternal/app/core_test.go | 2+-
Minternal/app/doc/completions.txt | 10++++++----
Minternal/config/toml_test.go | 2+-
Minternal/config/vars.go | 12------------
Minternal/config/vars_test.go | 4----
6 files changed, 8 insertions(+), 23 deletions(-)

diff --git a/internal/app/core.go b/internal/app/core.go @@ -250,7 +250,6 @@ func Usage(verbose bool, exe string) ([]string, error) { RemoveCommand: RemoveCommand, ReKeyCommand: ReKeyCommand, CompletionsCommand: CompletionsCommand, - CompletionsEnv: config.EnvDefaultCompletionKey, } document.ReKey.KeyFile = setDocFlag(reKeyFlags.KeyFile) document.ReKey.NoKey = reKeyFlags.NoKey diff --git a/internal/app/core_test.go b/internal/app/core_test.go @@ -13,7 +13,7 @@ func TestUsage(t *testing.T) { t.Errorf("invalid usage, out of date? %d", len(u)) } u, _ = app.Usage(true, "lb") - if len(u) != 98 { + if len(u) != 99 { t.Errorf("invalid verbose usage, out of date? %d", len(u)) } for _, usage := range u { diff --git a/internal/app/doc/completions.txt b/internal/app/doc/completions.txt @@ -1,4 +1,6 @@ -Completions are available for certain shells and detect available completions -determined by other environment settings. Completion command detection can be -disabled by setting {{ $.CompletionsEnv }}. Generation of completions are -handled by `{{ $.Executable }} {{ $.CompletionsCommand }}` +Completions are available for certain shells. Generation of completions is +handled by `{{ $.Executable }} {{ $.CompletionsCommand }}` (detecting the +shell by default), provide an additional argument to the command of a +the specific shell to generate completions for. Generated completions use +various `{{ $.Executable }}` settings to disable components depending on +user settings. diff --git a/internal/config/toml_test.go b/internal/config/toml_test.go @@ -259,7 +259,7 @@ func TestDefaultTOMLToLoadFile(t *testing.T) { count++ } } - if count != 31 { + if count != 30 { t.Errorf("invalid environment after load: %d", count) } } diff --git a/internal/config/vars.go b/internal/config/vars.go @@ -72,18 +72,6 @@ var ( desc: "Enable clipboard operations.", }), }) - // EnvDefaultCompletion disable completion detection - EnvDefaultCompletion = environmentRegister( - EnvironmentBool{ - environmentDefault: newDefaultedEnvironment(false, - environmentBase{ - cat: defaultCategory, - subKey: "COMPLETION", - desc: "Use the default completion set (disable detection).", - }), - }) - // EnvDefaultCompletionKey is the key for default completion handling - EnvDefaultCompletionKey = EnvDefaultCompletion.Key() // EnvColorEnabled indicates if colors are enabled EnvColorEnabled = environmentRegister( EnvironmentBool{ diff --git a/internal/config/vars_test.go b/internal/config/vars_test.go @@ -75,10 +75,6 @@ func TestIsTitle(t *testing.T) { checkYesNo("LOCKBOX_PWGEN_TITLE", t, config.EnvPasswordGenTitle, true) } -func TestDefaultCompletions(t *testing.T) { - checkYesNo("LOCKBOX_DEFAULTS_COMPLETION", t, config.EnvDefaultCompletion, false) -} - func TestTOTP(t *testing.T) { t.Setenv("LOCKBOX_TOTP_ENTRY", "abc") if config.EnvTOTPEntry.Get() != "abc" {