diff --git a/cmd/sbctl/main.go b/cmd/sbctl/main.go index 9daa7ac..d427f46 100644 --- a/cmd/sbctl/main.go +++ b/cmd/sbctl/main.go @@ -36,7 +36,7 @@ func baseFlags(cmd *cobra.Command) { flags := cmd.PersistentFlags() flags.BoolVar(&cmdOptions.JsonOutput, "json", false, "Output as json") - cmd.PreRun = func(cmd *cobra.Command, args []string) { + cmd.PersistentPreRun = func(cmd *cobra.Command, args []string) { if cmdOptions.JsonOutput { logging.PrintOff() }