mirror of
https://github.com/cuberite/TCLAP.git
synced 2025-09-10 04:41:57 -04:00
make error message a bit more meaningful
This commit is contained in:
parent
ab82cc7f87
commit
b8b1bb2467
@ -197,7 +197,15 @@ inline bool SwitchArg::processArg(int *i, std::vector<std::string>& args)
|
||||
ret = true;
|
||||
|
||||
if ( _alreadySet || ( !ret && combinedSwitchesMatch( args[*i] ) ) )
|
||||
throw(CmdLineParseException("Argument already set!", toString()));
|
||||
{
|
||||
if ( _xorSet )
|
||||
throw(CmdLineParseException(
|
||||
"Mutually exclusive argument already set!",
|
||||
toString()));
|
||||
else
|
||||
throw(CmdLineParseException("Argument already set!",
|
||||
toString()));
|
||||
}
|
||||
|
||||
_alreadySet = true;
|
||||
|
||||
|
@ -335,7 +335,15 @@ bool ValueArg<T>::processArg(int *i, std::vector<std::string>& args)
|
||||
if ( argMatches( flag ) )
|
||||
{
|
||||
if ( _alreadySet )
|
||||
throw( CmdLineParseException("Argument already set!", toString()) );
|
||||
{
|
||||
if ( _xorSet )
|
||||
throw( CmdLineParseException(
|
||||
"Mutually exclusive argument already set!",
|
||||
toString()) );
|
||||
else
|
||||
throw( CmdLineParseException("Argument already set!",
|
||||
toString()) );
|
||||
}
|
||||
|
||||
if ( Arg::delimiter() != ' ' && value == "" )
|
||||
throw( ArgParseException(
|
||||
|
@ -1,5 +1,5 @@
|
||||
PARSE ERROR: Argument: -b (--bbb)
|
||||
Argument already set!
|
||||
Mutually exclusive argument already set!
|
||||
|
||||
Brief USAGE:
|
||||
../examples/test5 {-a <string>|-b <string>} {--eee <string>|--fff
|
||||
|
@ -1,5 +1,5 @@
|
||||
PARSE ERROR: Argument: -b (--bbb)
|
||||
Argument already set!
|
||||
Mutually exclusive argument already set!
|
||||
|
||||
Brief USAGE:
|
||||
../examples/test5 {-a <string>|-b <string>} {--eee <string>|--fff
|
||||
|
Loading…
x
Reference in New Issue
Block a user