Skip to content

Commit

Permalink
add command flag completion
Browse files Browse the repository at this point in the history
  • Loading branch information
Janelle Law committed Nov 10, 2023
1 parent 329814a commit 60922f0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/opni/commands/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,12 @@ func BuildDebugAgentLogStreamGetCmd() *cobra.Command {
cmd.Flags().StringVar(&level, "level", "info", "Minimum log level severity (debug, info, warn, error)")
cmd.Flags().StringVar(&output, "output", "text", "Output format")
cmd.Flags().BoolVar(&follow, "follow", false, "Follow logs")
cmd.RegisterFlagCompletionFunc("level", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return []string{"debug", "info", "warn", "error"}, cobra.ShellCompDirectiveDefault
})
cmd.RegisterFlagCompletionFunc("output", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return []string{"text", "json"}, cobra.ShellCompDirectiveDefault
})
return cmd
}

Expand Down

0 comments on commit 60922f0

Please sign in to comment.