Show 'correct' explicit bool value syntax in help#453
Show 'correct' explicit bool value syntax in help#453tomasaschan merged 1 commit intospf13:masterfrom
Conversation
flag_test.go
Outdated
| const defaultOutput = ` --A[=value] for bootstrapping, allow 'any' type | ||
| --Alongflagname[=value] disable bounds checking | ||
| -C, --CCC[=value] a boolean defaulting to true (default true) |
There was a problem hiding this comment.
I think I'd prefer if this said [=true|false] or something like that, to clarify that those are the only valid values. Since the implementation special-cases bool values anyway, that should be relatively straightforward to implement, I think. Not sure what the best format in the help is, though - effectively there are four ways to get two values, and that easily gets confusing:
- omit the flag, get the default value
- specify the flag without a value, get true
- specify the flag with a value, either true or false, and get that
Can we somehow convey all those effects in the help output?
There was a problem hiding this comment.
I called it value as the alternative (with varname != "") would look like [=foo] (also that [=true|false] just seemed too long...but sure, bool is special enough anyway.
Re "specify the flag without a value to get true", not sure...
ad99c53 to
666b603
Compare
tomasaschan
left a comment
There was a problem hiding this comment.
Thanks for your contribution!
Here's my suggestion from #410 to (begin to) resolve it.