You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently ARG_OPTIONAL_BOOLEAN is displayed like so:
$ ./foo.sh --help
foo!
Usage: ./foo.sh [--(no-)no-deps]
-n,--no-deps,--no-no-deps: some description
With many of those the negating (no-) text adds a lot of visual noise and can be borderline silly as in the above case. I would imagine that most people have no use for an option flag that equals the application's default value.
Proposal:
Remove the (no-) and ,--no-<some-option> portions in the help output for ARG_OPTIONAL_BOOLEAN, or at least make it's display configurable.
The text was updated successfully, but these errors were encountered:
There is an obvious bug - if the boolean option begins by no-, the (no-) should not be prepended.
You are right that the current system suits boolean options that have no obvious default and that are likely to be switched from off to on.
Another boolean option macro should be introduced. This requires a bit of thinking, thank you for bringing it up!
I was thinking adding another argument to the existing macro like ARG_OPTIONAL_BOOLEAN(...[create-negating]),which is disabled per default and optional, would solve the issue.
I can't really think of a use case where creating the negating option for the boolean would make sense, considering every ARG_OPTIONAL_BOOLEAN has a default value. Take for example --(no-)verbose, as it's default value is off why would a user ever want to pass --no-verbose to the script? It just adds visual noise to the help output and might even confuse the user in some cases.
Currently
ARG_OPTIONAL_BOOLEAN
is displayed like so:With many of those the negating
(no-)
text adds a lot of visual noise and can be borderline silly as in the above case. I would imagine that most people have no use for an option flag that equals the application's default value.Proposal:
Remove the
(no-)
and,--no-<some-option>
portions in the help output forARG_OPTIONAL_BOOLEAN
, or at least make it's display configurable.The text was updated successfully, but these errors were encountered: