Closed dbear496 closed 3 months ago
@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?
Thank you for the clarification. Unfortunately, I'm not going to have the time to make a PR for this change.
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:
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 adefaultValue
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.