commit 952ad1181c55b21bdfff7d996fcb1dc11ffc8fba
parent 4a196a6b3c3af29a2bd3ddbe7db71d61cb8bdcc9
Author: Sean Enck <sean@ttypty.com>
Date: Sun, 3 Sep 2023 06:19:17 -0400
interactive password completions can not list
Diffstat:
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/internal/app/completions.go b/internal/app/completions.go
@@ -9,6 +9,10 @@ import (
"github.com/enckse/lockbox/internal/config"
)
+const (
+ noList = "echo \"\""
+)
+
type (
// Completions handles the inputs to completions for templating
Completions struct {
@@ -77,6 +81,14 @@ func GenerateCompletions(isBash, defaults bool, exe string) ([]string, error) {
if noTOTP {
isTOTP = false
}
+ k, err := config.GetKey()
+ if err != nil {
+ return nil, err
+ }
+ if k != nil && k.Interactive() {
+ c.DoList = noList
+ c.DoTOTPList = noList
+ }
}
c.CanClip = isClip
c.ReadOnly = isReadOnly