options: accept compacted option arguments

ex: -n1
This commit is contained in:
zawz 2019-08-29 17:18:26 +02:00
parent 829e95ad8d
commit 60cc951679

View file

@ -229,10 +229,7 @@ std::vector<std::string> ztd::option_set::process(std::vector<std::string> argum
}
else //continue
{
if( (*it)[i] != '=') //incorrect
{
throw ztd::option_error(ztd::option_error::missing_arg, std::string("-") + popt->charName );
}
if( (*it)[i] == '=')
i++;
popt->argument = (*it).substr(i , (*it).size()-i );
popt->activated = true;