mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-03 14:03:52 +00:00
Slighly better error message
This commit is contained in:
parent
cb2646a56c
commit
6a3b111b71
@ -1,4 +1,9 @@
|
||||
## Version 0.8 (in progress)
|
||||
|
||||
* Moved to CLTools on GitHub
|
||||
|
||||
## Version 0.7
|
||||
|
||||
* Allow comments in ini files (lines starting with `;`)
|
||||
* Ini files support flags, vectors, subcommands
|
||||
* Added CodeCov code coverage reports
|
||||
|
@ -155,12 +155,12 @@ public:
|
||||
|
||||
/// Set the number of expected arguments (Flags bypass this)
|
||||
Option* expected(int value) {
|
||||
if(!changeable_)
|
||||
throw IncorrectConstruction("You can only change the expected arguments for vectors");
|
||||
else if(value == 0)
|
||||
if(value == 0)
|
||||
throw IncorrectConstruction("Cannot set 0 expected, use a flag instead");
|
||||
else if(expected_ == 0)
|
||||
throw IncorrectConstruction("Cannot make a flag take arguments!");
|
||||
else if(!changeable_)
|
||||
throw IncorrectConstruction("You can only change the expected arguments for vectors");
|
||||
expected_ = value;
|
||||
return this;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user