Don’t assume first CL arg (exe name) is present

Fixes #729
This commit is contained in:
Phil Nash
2017-03-13 11:00:58 +00:00
parent db9866677e
commit 38b05f1400
6 changed files with 66 additions and 7 deletions

View File

@@ -927,7 +927,7 @@ namespace Clara {
}
std::vector<Parser::Token> parseInto( std::vector<std::string> const& args, ConfigT& config ) const {
std::string processName = args[0];
std::string processName = args.empty() ? std::string() : args[0];
std::size_t lastSlash = processName.find_last_of( "/\\" );
if( lastSlash != std::string::npos )
processName = processName.substr( lastSlash+1 );