Skip to content
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

Improve ARG_OPTIONAL_BOOLEAN help display #2

Open
edannenberg opened this issue Feb 13, 2017 · 3 comments
Open

Improve ARG_OPTIONAL_BOOLEAN help display #2

edannenberg opened this issue Feb 13, 2017 · 3 comments

Comments

@edannenberg
Copy link

edannenberg commented Feb 13, 2017

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.

@matejak
Copy link
Owner

matejak commented Feb 13, 2017

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!

@edannenberg
Copy link
Author

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.

@matejak
Copy link
Owner

matejak commented Jun 23, 2017

See #14 for proposed solutions.

@matejak matejak added this to the 2.7.0 milestone Feb 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants