@@ -111,14 +111,15 @@ func createCliCommandTree(cmd *cobra.Command) {
111
111
return validLogLevels , cobra .ShellCompDirectiveDefault
112
112
})
113
113
cmd .PersistentFlags ().String ("log-file" , "" , tr ("Path to the file where logs will be written." ))
114
- validFormats := []string {"text" , "json" }
115
- cmd .PersistentFlags ().String ("log-format" , "" , tr ("The output format for the logs, can be: %s" , strings .Join (validFormats , ", " )))
114
+ validLogFormats := []string {"text" , "json" }
115
+ cmd .PersistentFlags ().String ("log-format" , "" , tr ("The output format for the logs, can be: %s" , strings .Join (validLogFormats , ", " )))
116
116
cmd .RegisterFlagCompletionFunc ("log-format" , func (cmd * cobra.Command , args []string , toComplete string ) ([]string , cobra.ShellCompDirective ) {
117
- return validFormats , cobra .ShellCompDirectiveDefault
117
+ return validLogFormats , cobra .ShellCompDirectiveDefault
118
118
})
119
- cmd .PersistentFlags ().StringVar (& outputFormat , "format" , "text" , tr ("The output format for the logs, can be: %s" , strings .Join (validFormats , ", " )))
119
+ validOutputFormats := []string {"text" , "json" , "jsonmini" }
120
+ cmd .PersistentFlags ().StringVar (& outputFormat , "format" , "text" , tr ("The output format for the logs, can be: %s" , strings .Join (validOutputFormats , ", " )))
120
121
cmd .RegisterFlagCompletionFunc ("format" , func (cmd * cobra.Command , args []string , toComplete string ) ([]string , cobra.ShellCompDirective ) {
121
- return validFormats , cobra .ShellCompDirectiveDefault
122
+ return validOutputFormats , cobra .ShellCompDirectiveDefault
122
123
})
123
124
cmd .PersistentFlags ().StringVar (& configFile , "config-file" , "" , tr ("The custom config file (if not specified the default will be used)." ))
124
125
cmd .PersistentFlags ().StringSlice ("additional-urls" , []string {}, tr ("Comma-separated list of additional URLs for the Boards Manager." ))
@@ -144,9 +145,10 @@ func toLogLevel(s string) (t logrus.Level, found bool) {
144
145
145
146
func parseFormatString (arg string ) (feedback.OutputFormat , bool ) {
146
147
f , found := map [string ]feedback.OutputFormat {
147
- "json" : feedback .JSON ,
148
- "text" : feedback .Text ,
149
- }[arg ]
148
+ "json" : feedback .JSON ,
149
+ "jsonmini" : feedback .JSONMini ,
150
+ "text" : feedback .Text ,
151
+ }[strings .ToLower (arg )]
150
152
151
153
return f , found
152
154
}
0 commit comments