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

Documentation unclear re. default for negatable options #2217

Closed
dbear496 opened this issue Feb 27, 2024 · 2 comments
Closed

Documentation unclear re. default for negatable options #2217

dbear496 opened this issue Feb 27, 2024 · 2 comments

Comments

@dbear496
Copy link

I am new to picocli, so I'm perusing the documentation to see how I can use it in my project. I came across the following section on negatable options which is a bit unclear:

Screenshot_20240227_103009

This clearly states, "If the negated form of the option is found, for example --no-verbose, the value is set to the provided default. Otherwise, with a regular call, for example --verbose, it is set to the opposite of the default." However, the truth table that follows seems to indicate the exact opposite: when --backup has a defaultValue true, then --no-backup sets the value to false, and --backup sets the value to true. Which is it? It looks like these are contradicting.

@remkop
Copy link
Owner

remkop commented Feb 28, 2024

@dbear496 thank you for raising this.
I agree this is confusing. I believe the truth table is correct. It is no longer the case that the value is toggled from the default.

The docs should be modified to clarify that the negated form (for example, --no-verbose) sets the value to false, while the regular form (for example, --verbose) sets the value to true.

Will you be able to provide a pull request with a doc (docs/index.adoc) fix?

@dbear496
Copy link
Author

Thank you for the clarification. Unfortunately, I'm not going to have the time to make a PR for this change.

@remkop remkop closed this as completed in 1dd8632 Apr 10, 2024
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