diff options
Diffstat (limited to 'commands/user.go')
-rw-r--r-- | commands/user.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/commands/user.go b/commands/user.go index b6a2e485..0fe3be4d 100644 --- a/commands/user.go +++ b/commands/user.go @@ -3,6 +3,7 @@ package commands import ( "errors" "fmt" + "strings" "github.com/spf13/cobra" @@ -24,6 +25,7 @@ func newUserCommand() *cobra.Command { RunE: closeBackend(env, func(cmd *cobra.Command, args []string) error { return runUser(env, options, args) }), + ValidArgsFunction: completeUser(env), } cmd.AddCommand(newUserAdoptCommand()) @@ -33,8 +35,10 @@ func newUserCommand() *cobra.Command { flags := cmd.Flags() flags.SortFlags = false + fields := []string{"email", "humanId", "id", "lastModification", "lastModificationLamports", "login", "metadata", "name"} flags.StringVarP(&options.fields, "field", "f", "", - "Select field to display. Valid values are [email,humanId,id,lastModification,lastModificationLamports,login,metadata,name]") + "Select field to display. Valid values are ["+strings.Join(fields, ",")+"]") + cmd.RegisterFlagCompletionFunc("field", completeFrom(fields)) return cmd } |