1
0
Fork 0

Properly handle argumenets with no assigned value (e.g. --hla)

This commit is contained in:
Erik Hofman 2021-03-09 15:56:46 +01:00
parent c24e0fb5b8
commit 563737bed1

View file

@ -43,8 +43,8 @@ ArgumentParser::ArgumentParser(int argc, char **argv) :
val = arg.substr(pos+1); val = arg.substr(pos+1);
arg = arg.substr(0, pos); arg = arg.substr(0, pos);
} }
else if (++i<argc) { else if ((i+1)<argc && argv[i+1][0] != '-') {
val = argv[i]; val = argv[++i];
} else { } else {
val = ""; val = "";
} }