Fix subcommand locations with NoOptDefValue flags (#391)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
If one ran a command like ./root --boolFlag subcmd1 subcmd2 Thing worked fine. The code recognized that --boolFlag followed by a space meant the next word was not the argument to --boolFlag. But other flag types with a NoOptDefValue (like a Count flag) would not ignore the "argument". On a command like: ./root --countflag subcmd1 subcmd2 The processor, when looking for a subcommand, would first throw out the `--countflag subcmd1` and then look for subcmd2 under root. The fix is to ignore the next word after any NoOptDefVal flag, not just boolean flags.
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+7 added−9 removed
- other:+7 added−9 removed