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

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

No files matched your search

+1 -1
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 );