Add formatters.Preferred

This commit is contained in:
Dan Jones 2024-03-09 16:05:59 -06:00
commit febbce8a6b
4 changed files with 22 additions and 2 deletions

View file

@ -60,7 +60,7 @@ var dropCmd = &cobra.Command{
return err
}
form, err := formatters.New("plain")
form, err := formatters.Preferred()
if err != nil {
return err
}

View file

@ -50,7 +50,7 @@ func init() {
// will be global for your application.
rootCmd.PersistentFlags().StringVarP(&config.ConfigPath, "config", "c", config.ConfigPath, "config file")
rootCmd.PersistentFlags().StringToStringVarP(&config.Overrides, "config-value", "v", config.Overrides, "Override config values. Use dot syntax to specify key. E.g. -v output.stdout.config.json=true")
rootCmd.PersistentFlags().StringToStringVarP(&config.Overrides, "config-value", "v", config.Overrides, "Override config values. Use dot syntax to specify key. E.g. -v output.stdout.config.formatter=json")
// Cobra also supports local flags, which will only run
// when this action is called directly.