feat(completions): wire up key completions for key commands

This commit is contained in:
Lewis Wynne 2026-03-16 16:31:57 +00:00
parent 84b1c67c72
commit bc0b98c7f9
5 changed files with 32 additions and 25 deletions

View file

@ -30,21 +30,23 @@ import (
)
var cpCmd = &cobra.Command{
Use: "copy FROM[@STORE] TO[@STORE]",
Aliases: []string{"cp"},
Short: "Make a copy of a key",
Args: cobra.ExactArgs(2),
RunE: cp,
SilenceUsage: true,
Use: "copy FROM[@STORE] TO[@STORE]",
Aliases: []string{"cp"},
Short: "Make a copy of a key",
Args: cobra.ExactArgs(2),
ValidArgsFunction: completeKeys,
RunE: cp,
SilenceUsage: true,
}
var mvCmd = &cobra.Command{
Use: "move FROM[@STORE] TO[@STORE]",
Aliases: []string{"mv"},
Short: "Move a key",
Args: cobra.ExactArgs(2),
RunE: mv,
SilenceUsage: true,
Use: "move FROM[@STORE] TO[@STORE]",
Aliases: []string{"mv"},
Short: "Move a key",
Args: cobra.ExactArgs(2),
ValidArgsFunction: completeKeys,
RunE: mv,
SilenceUsage: true,
}
func cp(cmd *cobra.Command, args []string) error {