Commit 3f0d2bd6 authored by Joshua Gutow's avatar Joshua Gutow

oplog: Only set cfg.Color if the flag is present

parent 4be08d5e
...@@ -82,7 +82,9 @@ func ReadLocalCLIConfig(ctx *cli.Context) CLIConfig { ...@@ -82,7 +82,9 @@ func ReadLocalCLIConfig(ctx *cli.Context) CLIConfig {
cfg := DefaultCLIConfig() cfg := DefaultCLIConfig()
cfg.Level = ctx.String(LevelFlagName) cfg.Level = ctx.String(LevelFlagName)
cfg.Format = ctx.String(FormatFlagName) cfg.Format = ctx.String(FormatFlagName)
cfg.Color = ctx.Bool(ColorFlagName) if ctx.IsSet(ColorFlagName) {
cfg.Color = ctx.Bool(ColorFlagName)
}
return cfg return cfg
} }
...@@ -90,7 +92,9 @@ func ReadCLIConfig(ctx *cli.Context) CLIConfig { ...@@ -90,7 +92,9 @@ func ReadCLIConfig(ctx *cli.Context) CLIConfig {
cfg := DefaultCLIConfig() cfg := DefaultCLIConfig()
cfg.Level = ctx.GlobalString(LevelFlagName) cfg.Level = ctx.GlobalString(LevelFlagName)
cfg.Format = ctx.GlobalString(FormatFlagName) cfg.Format = ctx.GlobalString(FormatFlagName)
cfg.Color = ctx.GlobalBool(ColorFlagName) if ctx.IsSet(ColorFlagName) {
cfg.Color = ctx.GlobalBool(ColorFlagName)
}
return cfg return cfg
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment