⚙️ Move preferred formatter to its own config field
This commit is contained in:
parent
ce83cf1cc2
commit
cfeab035d3
6 changed files with 12 additions and 7 deletions
|
|
@ -44,7 +44,7 @@ var DropCmd = &cobra.Command{
|
|||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
v, _ := config.RetrieveFromContext(cmd.Context())
|
||||
if outJson {
|
||||
v.Set("output.stdout.config.format", "json")
|
||||
v.Set("formatters.preferred", "json")
|
||||
}
|
||||
|
||||
log := args[0]
|
||||
|
|
|
|||
|
|
@ -63,5 +63,5 @@ var configValues map[string]string
|
|||
|
||||
func init() {
|
||||
RootCmd.PersistentFlags().StringVarP(&configPath, "config", "c", config.DefaultPath(), "config file")
|
||||
RootCmd.PersistentFlags().StringToStringVarP(&configValues, "config-value", "v", nil, "Override config values. Use dot syntax to specify key. E.g. -v output.stdout.config.format=json")
|
||||
RootCmd.PersistentFlags().StringToStringVarP(&configValues, "config-value", "v", nil, "Override config values. Use dot syntax to specify key. E.g. -v formatters.preferred=json")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue