util/OptionParser: add struct Result

Prepare for option values.
This commit is contained in:
Max Kellermann
2018-01-17 11:00:07 +01:00
parent d588da69e5
commit c45fe3517c
3 changed files with 17 additions and 13 deletions

View File

@@ -309,9 +309,8 @@ ParseCommandLine(int argc, char **argv, struct options &options)
// First pass: handle command line options
OptionParser parser(option_defs, argc, argv);
int option_index;
while ((option_index = parser.Next()) >= 0) {
switch (Option(option_index)) {
while (auto o = parser.Next()) {
switch (Option(o.index)) {
case OPTION_KILL:
options.kill = true;
break;