Skip to content

Commit

Permalink
Add '--log' global flag as alias for '-v' (#2258)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie authored Aug 4, 2023
1 parent 1923ac4 commit 246adf9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ func createCliCommandTree(cmd *cobra.Command) {
cmd.AddCommand(feedback.NewCommand())

cmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, tr("Print the logs on the standard output."))
cmd.Flag("verbose").Hidden = true
cmd.PersistentFlags().BoolVar(&verbose, "log", false, tr("Print the logs on the standard output."))
validLogLevels := []string{"trace", "debug", "info", "warn", "error", "fatal", "panic"}
cmd.PersistentFlags().String("log-level", "", tr("Messages with this level and above will be logged. Valid levels are: %s", strings.Join(validLogLevels, ", ")))
cmd.RegisterFlagCompletionFunc("log-level", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
Expand Down

0 comments on commit 246adf9

Please sign in to comment.