-
Notifications
You must be signed in to change notification settings - Fork 108
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
Drop placeholders to display default value for flags where it is set. #1207
base: main
Are you sure you want to change the base?
Conversation
@ripienaar WDYT? |
cli/auth_account_command.go
Outdated
@@ -117,14 +117,14 @@ func configureAuthAccountCommand(auth commandHost) { | |||
f.Flag("jetstream", "Enables JetStream").Default("false").IsSetByUser(&c.jetStreamIsSet).BoolVar(&c.jetStream) | |||
f.Flag("js-consumers", "Sets the maximum Consumers the account can have").Default("-1").IsSetByUser(&c.maxConsumersIsSet).Int64Var(&c.maxConsumers) | |||
f.Flag("js-disk", "Sets a Disk Storage quota").PlaceHolder("BYTES").StringVar(&c.storeMaxString) | |||
f.Flag("js-disk-stream", "Sets the maximum size a Disk Storage stream may be").PlaceHolder("BYTES").Default("-1").StringVar(&c.storeMaxStreamString) | |||
f.Flag("js-disk-stream", "Sets the maximum size a Disk Storage stream may be").Default("-1").StringVar(&c.storeMaxStreamString) |
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.
I dont think universally just updating all of these with a script is the right approach, in the previous one where the default is something useful like 1w
it makes sense to show the default, here -1
is more an implementation detail than a useful default users should know about so the placement string should be used in stead.
We will need to evaluate each case and decide if it makes sense to show the default.
A lot of this code was written before fisk has IsSetByUser() and so some of these defaults are there only to compensate for the lack of that feature rather than a default thats useful to the user.
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.
@ripienaar would you be open to a separate PR, where places that use "meaningless" defaults are update to IsSetByUser ?
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.
Yes for now let’s drop placeholders only where it make sense. Later we can move to IsSetByUser()
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.
fixed those
Signed-off-by: Alex Bozhenko <[email protected]>
6b9ead7
to
00d2d2b
Compare
We can clean up those were both IsSetByUser and default is used separately: E.g. this should show a placeholder, and should not show default, right?
|
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.
looks good, just the one bit of redundant info we can now remove
@@ -40,7 +40,7 @@ func configureAccountTLSCommand(srv *fisk.CmdClause) { | |||
c := &ActTLSCmd{} | |||
|
|||
tls := srv.Command("tls", "Report TLS chain for connected server").Action(c.showTLS) | |||
tls.Flag("expire-warn", "Warn about certs expiring this soon (1w; 0 to disable)").Default("1w").PlaceHolder("DURATION").DurationVar(&c.expireWarnDuration) | |||
tls.Flag("expire-warn", "Warn about certs expiring this soon (1w; 0 to disable)").Default("1w").DurationVar(&c.expireWarnDuration) |
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.
Lets make this Warn about certs expiring this soon, 0 to disable
Dropped from all these lines:
Test plan: