diff --git a/cli/cli.go b/cli/cli.go index deee144da45..a29faa25a08 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -96,9 +96,9 @@ func createCliCommandTree(cmd *cobra.Command) { viper.BindPFlag("logging.level", cmd.PersistentFlags().Lookup("log-level")) cmd.PersistentFlags().String("log-file", "", "Path to the file where logs will be written.") viper.BindPFlag("logging.file", cmd.PersistentFlags().Lookup("log-file")) - cmd.PersistentFlags().String("log-format", "", "The output format for the logs, can be [text|json].") + cmd.PersistentFlags().String("log-format", "", "The output format for the logs, can be {text|json}.") viper.BindPFlag("logging.format", cmd.PersistentFlags().Lookup("log-format")) - cmd.PersistentFlags().StringVar(&outputFormat, "format", "text", "The output format, can be [text|json].") + cmd.PersistentFlags().StringVar(&outputFormat, "format", "text", "The output format, can be {text|json}.") cmd.PersistentFlags().StringVar(&configFile, "config-file", "", "The custom config file (if not specified the default will be used).") cmd.PersistentFlags().StringSlice("additional-urls", []string{}, "Additional URLs for the board manager.") viper.BindPFlag("board_manager.additional_urls", cmd.PersistentFlags().Lookup("additional-urls")) diff --git a/cli/completion/completion.go b/cli/completion/completion.go index ffe5472728e..c5412baadbc 100644 --- a/cli/completion/completion.go +++ b/cli/completion/completion.go @@ -56,14 +56,7 @@ func run(cmd *cobra.Command, args []string) { cmd.Root().GenBashCompletion(os.Stdout) break case "zsh": - buf := new(bytes.Buffer) - cmd.Root().GenZshCompletion(buf) - // Next 3 lines are Hack, we'll wait new version of cobra with ZshV2Completion https://github.com/spf13/cobra/pull/1070 - //insert escaping before [ and ] - s := strings.ReplaceAll(buf.String(), "[", "\\[") - s = strings.ReplaceAll(s, "]", "\\]") - s = strings.ReplaceAll(s, "\\[1\\]", "[1]") // revert the case - os.Stdout.WriteString(s) + cmd.Root().GenZshCompletion(os.Stdout) break case "fish": buf := new(bytes.Buffer)