globals: setGlobals() - quiet, debug, json, noColor for both app and command specific.
This commit is contained in:
+4
-4
@@ -72,9 +72,9 @@ func setGlobals(quiet, debug, json, noColor bool) {
|
||||
|
||||
// Set global states. NOTE: It is deliberately kept monolithic to ensure we dont miss out any flags.
|
||||
func setGlobalsFromContext(ctx *cli.Context) {
|
||||
quiet := ctx.Bool("quiet")
|
||||
debug := ctx.Bool("debug")
|
||||
json := ctx.Bool("json")
|
||||
noColor := ctx.Bool("no-color")
|
||||
quiet := ctx.Bool("quiet") || ctx.GlobalBool("quiet")
|
||||
debug := ctx.Bool("debug") || ctx.GlobalBool("debug")
|
||||
json := ctx.Bool("json") || ctx.GlobalBool("json")
|
||||
noColor := ctx.Bool("no-color") || ctx.GlobalBool("no-color")
|
||||
setGlobals(quiet, debug, json, noColor)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user