Given code like this:
@Option(names = "--crash-report", defaultValue = "true", negatable = true)
private boolean crashReportEnabled;
@Option(names = "--homedir")
private Path homeDir;
if invoked with --homedir --crash-report, it quits as expected with this message:
Expected parameter for option '--homedir' but found '--crash-report'
But if invoked with the boolean option's negated form --homedir --no-crash-report it assigns --no-crash-report as the value of homeDir.
using picocli and picocli-codegen version 4.5.1.
Thank you for reporting this!
That looks like a bug. Looking into it.
Sorry for the delay.
I found the cause and pushed a fix to master.
This fix will be included in the next release.
Thanks again for raising this!
Picocli 4.5.2, which contains the fix for this issue, has been released.
Enjoy!
Most helpful comment
Picocli 4.5.2, which contains the fix for this issue, has been released.
Enjoy!