-
Notifications
You must be signed in to change notification settings - Fork 354
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
Weird behavior when wrong option was given #461
Comments
What operation are you using to check? I am not sure there is an empty() function on a CLI11::App? or are you doing it on each option separately?
if allow_extras() is set to true then the processing won't error when an unrecognized argument is passed. but it will be available in |
Sure there is:
But like I said, the lib shows weird behaviour since code after the parsing in the try-catch block no code below is executed anymore. |
From the code: "This returns the missing options from the current subcommand" |
By default, extra options are not allowed. You have to set Since you mentioned the try-catch block, maybe you are forgetting to |
I'm doing the app.exit and it doesn't seem to work. If I can find some time I'll do a simple example, but I can't promise. |
This CLI11 update from v1.9.0 to v1.9.1 provides the following improvements: - Support relative inclusion [#475](CLIUtils/CLI11#475) - Fix cases where spaces in paths could break CMake support [#471](CLIUtils/CLI11#471) - Fix an issue with string conversion [#421](CLIUtils/CLI11#421) - Cross-compiling improvement for Conan.io [#430](CLIUtils/CLI11#430) - Fix option group default propagation [#450](CLIUtils/CLI11#450) - Fix for C++20 [#459](CLIUtils/CLI11#459) - Support compiling with RTTI off [#461](CLIUtils/CLI11#461)
This CLI11 update from v1.9.0 to v1.9.1 provides the following improvements: - Support relative inclusion [#475](CLIUtils/CLI11#475) - Fix cases where spaces in paths could break CMake support [#471](CLIUtils/CLI11#471) - Fix an issue with string conversion [#421](CLIUtils/CLI11#421) - Cross-compiling improvement for Conan.io [#430](CLIUtils/CLI11#430) - Fix option group default propagation [#450](CLIUtils/CLI11#450) - Fix for C++20 [#459](CLIUtils/CLI11#459) - Support compiling with RTTI off [#461](CLIUtils/CLI11#461)
When I have defined a few options but NOT "-x" and then I call the program with "-x" then no error is given and my if() is never reached where I'm testing for mycli11.empty() with each defined option!
Request:
It would be good to have a count of given valid options/flags and a count of invalid options/flags after parsing.
The text was updated successfully, but these errors were encountered: