lockbox

password manager
Log | Files | Refs | README | LICENSE

commit 257b6c5124e139ce377d7cce6598bb3ba995208c
parent e44e3dfde6f4bb7f7c884fc7b5f072b83e864a7c
Author: Sean Enck <sean@ttypty.com>
Date:   Mon, 27 Mar 2023 19:26:34 -0400

don't bother with local var

Diffstat:
Minternal/cli/core.go | 9++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/internal/cli/core.go b/internal/cli/core.go @@ -146,6 +146,7 @@ func BashCompletions(defaults bool) ([]string, error) { MoveCommand: MoveCommand, DoList: fmt.Sprintf("%s %s", name, ListCommand), DoTOTPList: fmt.Sprintf("%s %s %s", name, TOTPCommand, TOTPListCommand), + Options: []string{EnvCommand, FindCommand, HelpCommand, ListCommand, ShowCommand, VersionCommand, StatsCommand}, } isReadOnly := false isClip := true @@ -174,18 +175,16 @@ func BashCompletions(defaults bool) ([]string, error) { c.CanClip = isClip c.ReadOnly = isReadOnly c.CanTOTP = isTOTP - options := []string{EnvCommand, FindCommand, HelpCommand, ListCommand, ShowCommand, VersionCommand, StatsCommand} if c.CanClip { - options = append(options, ClipCommand) + c.Options = append(c.Options, ClipCommand) c.TOTPSubCommands = append(c.TOTPSubCommands, TOTPClipCommand) } if !c.ReadOnly { - options = append(options, MoveCommand, RemoveCommand, InsertCommand) + c.Options = append(c.Options, MoveCommand, RemoveCommand, InsertCommand) } if c.CanTOTP { - options = append(options, TOTPCommand) + c.Options = append(c.Options, TOTPCommand) } - c.Options = options t, err := template.New("t").Parse(bashCompletions) if err != nil { return nil, err