lockbox

password manager
Log | Files | Refs | README | LICENSE

commit b54fe27136dd33aa16375572c209ceee96d94f07
parent 9a936c6507ce7cb8fdfa3f226c800a5ba77d24d1
Author: Sean Enck <sean@ttypty.com>
Date:   Sat,  7 Jun 2025 15:53:59 -0400

as a not fish shell user, maintaining this shall pause for a while

Diffstat:
MREADME.md | 2+-
Minternal/app/commands/core.go | 4+---
Minternal/app/completions/core_test.go | 1-
Dinternal/app/completions/shell/fish.sh | 52----------------------------------------------------
Minternal/app/help/core_test.go | 4++--
Minternal/app/info_test.go | 1-
6 files changed, 4 insertions(+), 60 deletions(-)

diff --git a/README.md b/README.md @@ -38,7 +38,7 @@ Use `lb help verbose` for additional information about functionality and `lb` should work on combinations of the following: - linux/macOS/WSL -- zsh/bash/fish (for completions) +- zsh/bash (for completions) - amd64/arm64 ## usage diff --git a/internal/app/commands/core.go b/internal/app/commands/core.go @@ -54,8 +54,6 @@ const ( JSON = "json" // CompletionsZsh is the command to generate zsh completions CompletionsZsh = "zsh" - // CompletionsFish is the command to generate fish completions - CompletionsFish = "fish" // PasswordGenerate is the command to do password generation PasswordGenerate = "pwgen" // Executable is the name of the executable @@ -68,7 +66,7 @@ const ( var ( // CompletionTypes are shell completions that are known - CompletionTypes = []string{CompletionsBash, CompletionsFish, CompletionsZsh} + CompletionTypes = []string{CompletionsBash, CompletionsZsh} // ReKeyFlags are the flags used for re-keying ReKeyFlags = struct { KeyFile string diff --git a/internal/app/completions/core_test.go b/internal/app/completions/core_test.go @@ -14,7 +14,6 @@ import ( func TestCompletions(t *testing.T) { for k, v := range map[string]string{ "zsh": "typeset -A opt_args", - "fish": "set -f commands", "bash": "local cur opts", } { testCompletion(t, k, v) diff --git a/internal/app/completions/shell/fish.sh b/internal/app/completions/shell/fish.sh @@ -1,52 +0,0 @@ -complete -c {{ $.Executable }} -f - - -function {{ $.Executable }}-completion - set -f commands "" - for line in ({{ $.ExportCommand }}) - set item (string split -m 1 "=" $line) - set -f $item[1] $item[2] - end -{{- range $idx, $value := $.Options }} - {{- if gt $idx 0 }} - set -f commands " $commands" - {{ end }} - if {{ $value.Conditional }} - set -f commands "{{ $value.Key }}$commands" - end -{{- end }} - complete -c {{ $.Executable }} -n "not __fish_seen_subcommand_from $commands" -a "$commands" - complete -c {{ $.Executable }} -n "__fish_seen_subcommand_from {{ $.HelpCommand }}; and test (count (commandline -opc)) -lt 3" -a "{{ $.HelpAdvancedCommand }} {{ $.HelpConfigCommand }}" - if {{ $.Conditionals.Not.ReadOnly }} - if {{ $.Conditionals.Not.AskMode }} - complete -c {{ $.Executable }} -n "__fish_seen_subcommand_from {{ $.InsertCommand }} {{ $.MultiLineCommand }} {{ $.RemoveCommand }}; and test (count (commandline -opc)) -lt 3" -a "({{ $.DoList }})" - complete -c {{ $.Executable }} -n "__fish_seen_subcommand_from {{ $.MoveCommand }}; and test (count (commandline -opc)) -lt 4" -a "({{ $.DoList }})" - end - end - if {{ $.Conditionals.Not.CanTOTP }} - set -f totpbase "{{ $.TOTPFindCommand }} {{ $.TOTPListCommand }}" - set -f totps " $totpbase" -{{- range $idx, $value := $.TOTPSubCommands }} - {{- if gt $idx 0 }} - set -f totps " $totps" - {{ end }} - if {{ $value.Conditional }} - set -f totps "{{ $value.Key }}$totps" - end -{{- end }} - complete -c {{ $.Executable }} -n "__fish_seen_subcommand_from {{ $.TOTPCommand }}; and not __fish_seen_subcommand_from $totps" -a "$totps" - if {{ $.Conditionals.Not.AskMode }} - complete -c {{ $.Executable }} -n "__fish_seen_subcommand_from {{ $.TOTPCommand }}; and __fish_seen_subcommand_from $totps; and not __fish_seen_subcommand_from $totpbase; and test (count (commandline -opc)) -lt 4" -a "({{ $.DoTOTPList }})" - end - end - if {{ $.Conditionals.Not.CanClip }} - if {{ $.Conditionals.Not.AskMode }} - complete -c {{ $.Executable }} -n "__fish_seen_subcommand_from {{ $.ClipCommand }}; and test (count (commandline -opc)) -lt 3" -a "({{ $.DoList}})" - end - end - if {{ $.Conditionals.Not.AskMode }} - complete -c {{ $.Executable }} -n "__fish_seen_subcommand_from {{ $.ShowCommand }} {{ $.JSONCommand }}; and test (count (commandline -opc)) -lt 3" -a "({{ $.DoList}})" - end -end - -{{ $.Executable }}-completion diff --git a/internal/app/help/core_test.go b/internal/app/help/core_test.go @@ -9,11 +9,11 @@ import ( func TestUsage(t *testing.T) { u, _ := help.Usage(false, "lb") - if len(u) != 29 { + if len(u) != 28 { t.Errorf("invalid usage, out of date? %d", len(u)) } u, _ = help.Usage(true, "lb") - if len(u) != 103 { + if len(u) != 102 { t.Errorf("invalid verbose usage, out of date? %d", len(u)) } for _, usage := range u { diff --git a/internal/app/info_test.go b/internal/app/info_test.go @@ -114,7 +114,6 @@ func TestEnvInfo(t *testing.T) { func TestCompletionInfo(t *testing.T) { for k, v := range map[string]string{ "zsh": "typeset -A opt_args", - "fish": "set -f commands", "bash": "local cur opts", } { for _, b := range []bool{true, false} {