-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Reorganize global CLI flags #2615
Conversation
cli/config.go
Outdated
"log-stacktrace": "log.stacktrace", | ||
"log-source": "log.source", | ||
"log-overrides": "log.overrides", | ||
"log-no-color": "log.nocolor", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Would be nice to have a consistent usage of no
and disable
terminology and the no
prefix to disable a feature.
For example: To disable key ring and p2p users use: no-keyring
and no-p2p
respectively, i.e. leading no
prefix
But for disabling log, it is log-no-color
rather than no-log-color
.
Now for config keys we use: keyring.disabled
net.p2pdisabled
(the disabled term)
But for log we have log.nocolor
instead of log.colordisabled
IMO would be nice to have at least user facing flags to be predictable / consistent in terminology.
cli/config.go
Outdated
@@ -138,6 +139,7 @@ func loadConfig(rootdir string, flags *pflag.FlagSet) (*viper.Viper, error) { | |||
Output: cfg.GetString("log.output"), | |||
EnableStackTrace: cfg.GetBool("log.stacktrace"), | |||
EnableSource: cfg.GetBool("log.source"), | |||
DisableColor: cfg.GetBool("log.nocolor"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: The // set default logging config
appears incorrect though - this is not setting the default, but instead takes from the CLI params? Suggest either changing the comment or removing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks Keenan :) One suggestion from me before merge, and I agree with Shahzad's no vs disable suggestion too
Relevant issue(s)
Resolves #2614
Resolves #2582
Description
This PR moves the global CLI flags that only apply to the start command. It also fixes the log color config issue above.
Tasks
How has this been tested?
make test
Specify the platform(s) on which this was tested: