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

Option to hide the default value in the help text #857

Open
LostInCompilation opened this issue Mar 9, 2023 · 1 comment
Open

Option to hide the default value in the help text #857

LostInCompilation opened this issue Mar 9, 2023 · 1 comment

Comments

@LostInCompilation
Copy link
Contributor

When I set a flag like this:

app.add_flag("--hidden,!--no-hidden", showHiddenFiles, "Show or hide hidden files");

the resulting help text looks like this:

--hidden, --no-hidden{false}          Show or hide hidden files

It would be nice to have the ability to hide the {false} part. I did not find such an option in the docs/code. Also using a custom formatter doesn't seem to help, since this behaviour is defined in std::string Option::get_name(bool positional, bool all_options).

@phlptp
Copy link
Collaborator

phlptp commented Jul 5, 2023

The intention was that the option name output should be such that it could be fed into add_option and it would register the same. So no modifiers to hide the {false} part were not considered as they would break that symmetry. Though this may be something we want have a means of doing via a custom formatter of some sort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants