@@ -111,14 +111,15 @@ func createCliCommandTree(cmd *cobra.Command) {
111111 return validLogLevels , cobra .ShellCompDirectiveDefault
112112 })
113113 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 , ", " )))
116116 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
118118 })
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 , ", " )))
120121 cmd .RegisterFlagCompletionFunc ("format" , func (cmd * cobra.Command , args []string , toComplete string ) ([]string , cobra.ShellCompDirective ) {
121- return validFormats , cobra .ShellCompDirectiveDefault
122+ return validOutputFormats , cobra .ShellCompDirectiveDefault
122123 })
123124 cmd .PersistentFlags ().StringVar (& configFile , "config-file" , "" , tr ("The custom config file (if not specified the default will be used)." ))
124125 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) {
144145
145146func parseFormatString (arg string ) (feedback.OutputFormat , bool ) {
146147 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 )]
150152
151153 return f , found
152154}
0 commit comments