You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -104,7 +100,7 @@ func Bootstrap(config *BootstrapConfig) (exitCode int, result interface{}, err e
104
100
105
101
// If debug flag is set enable debug mode in SDK logger
106
102
logLevel:=logger.LogLevelWarning
107
-
ifoutputFlag!=defaultOutput {
103
+
ifoutputFlag!=cliConfig.DefaultOutput {
108
104
logLevel=logger.LogLevelError
109
105
}
110
106
@@ -207,6 +203,18 @@ func Bootstrap(config *BootstrapConfig) (exitCode int, result interface{}, err e
207
203
return1, nil, err
208
204
}
209
205
meta.CliConfig=cliCfg
206
+
ifcliCfg.Output!=cliConfig.DefaultOutput {
207
+
outputFlag=cliCfg.Output
208
+
printer, err=NewPrinter(&PrinterConfig{
209
+
OutputFlag: outputFlag,
210
+
Stdout: config.Stdout,
211
+
Stderr: config.Stderr,
212
+
})
213
+
iferr!=nil {
214
+
_, _=fmt.Fprintln(config.Stderr, err)
215
+
return1, nil, err
216
+
}
217
+
}
210
218
211
219
// Check CLI new version when exiting the bootstrap
212
220
deferfunc() { // if we plan to remove defer, do not forget logger is not set until cobra pre init func
@@ -242,7 +250,7 @@ func Bootstrap(config *BootstrapConfig) (exitCode int, result interface{}, err e
242
250
// declaration in order for them to be shown in the cobra usage documentation.
243
251
rootCmd.PersistentFlags().StringVarP(&profileFlag, "profile", "p", "", "The config profile to use")
244
252
rootCmd.PersistentFlags().StringVarP(&configPathFlag, "config", "c", "", "The path to the config file")
245
-
rootCmd.PersistentFlags().StringVarP(&outputFlag, "output", "o", "human", "Output format: json or human, see 'scw help output' for more info")
253
+
rootCmd.PersistentFlags().StringVarP(&outputFlag, "output", "o", cliConfig.DefaultOutput, "Output format: json or human, see 'scw help output' for more info")
0 commit comments