mirror of
https://github.com/cuberite/TCLAP.git
synced 2025-09-10 12:49:08 -04:00
moved exit from CmdLine to StdOutput to provide users more control over when/how the exit happens
This commit is contained in:
parent
3718682c6d
commit
6b2cb3ab1d
@ -418,7 +418,7 @@ inline void CmdLine::parse(int argc, char** argv)
|
|||||||
if ( requiredCount > _numRequired )
|
if ( requiredCount > _numRequired )
|
||||||
throw(CmdLineParseException("Too many arguments!"));
|
throw(CmdLineParseException("Too many arguments!"));
|
||||||
|
|
||||||
} catch ( ArgException& e ) { _output->failure(*this,e); exit(1); }
|
} catch ( ArgException& e ) { _output->failure(*this,e); }
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool CmdLine::_emptyCombined(const std::string& s)
|
inline bool CmdLine::_emptyCombined(const std::string& s)
|
||||||
|
@ -192,6 +192,7 @@ inline void DocBookOutput::failure( CmdLineInterface& _cmd,
|
|||||||
ArgException& e )
|
ArgException& e )
|
||||||
{
|
{
|
||||||
std::cout << e.what() << std::endl;
|
std::cout << e.what() << std::endl;
|
||||||
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void DocBookOutput::substituteSpecialChars( std::string& s,
|
inline void DocBookOutput::substituteSpecialChars( std::string& s,
|
||||||
|
@ -148,6 +148,7 @@ inline void StdOutput::failure( CmdLineInterface& _cmd,
|
|||||||
else
|
else
|
||||||
usage(_cmd);
|
usage(_cmd);
|
||||||
|
|
||||||
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void StdOutput::_shortUsage( CmdLineInterface& _cmd,
|
inline void StdOutput::_shortUsage( CmdLineInterface& _cmd,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user