From 53645d3fb9fe1294cfd08fb58afaf05954980081 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 3 Aug 2023 14:37:02 +0200 Subject: [PATCH] Add '--log' global flag as alias for '-v' --- internal/cli/cli.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/cli/cli.go b/internal/cli/cli.go index 4f0e98c28bd..19a92767acf 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -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) {