Properly handle argumenets with no assigned value (e.g. --hla)
This commit is contained in:
parent
c24e0fb5b8
commit
563737bed1
1 changed files with 2 additions and 2 deletions
|
@ -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 = "";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue