diff --git a/credentials/commands/get.go b/credentials/commands/get.go index f0444bf..a435466 100644 --- a/credentials/commands/get.go +++ b/credentials/commands/get.go @@ -5,6 +5,7 @@ import ( "encoding/base64" "encoding/hex" "fmt" + "sort" "time" "github.com/atotto/clipboard" @@ -60,11 +61,13 @@ decrypting password.`, sources = append(sources, source) } + sort.Strings(sources) + var prompt survey.Prompt prompt = &survey.Select{ Message: "Source host:", Options: sources, - PageSize: 10, + PageSize: 20, VimMode: true, } @@ -85,7 +88,7 @@ decrypting password.`, prompt = &survey.Select{ Message: "Primary user key (and tag):", Options: keys, - PageSize: 10, + PageSize: 20, VimMode: true, } diff --git a/credentials/commands/list.go b/credentials/commands/list.go index 18951fe..c53ba3d 100644 --- a/credentials/commands/list.go +++ b/credentials/commands/list.go @@ -3,6 +3,7 @@ package commands import ( "context" "fmt" + "sort" "time" "github.com/spf13/cobra" @@ -52,10 +53,12 @@ includes almost all the information but the most sensitive.`, sources = append(sources, source) } + sort.Strings(sources) + prompt := &survey.Select{ Message: "Source host:", Options: sources, - PageSize: 10, + PageSize: 20, VimMode: true, }