diff options
author | Max Kellermann <max@musicpd.org> | 2018-01-17 11:00:07 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-01-17 11:08:05 +0100 |
commit | c45fe3517c5ac8bf761cc8d862ce3d90af272eec (patch) | |
tree | 15c7040120c8d4ddd612cd9f796c79d40c13a109 /src/CommandLine.cxx | |
parent | d588da69e57dad3bff8a90735736601de288a971 (diff) |
util/OptionParser: add struct Result
Prepare for option values.
Diffstat (limited to 'src/CommandLine.cxx')
-rw-r--r-- | src/CommandLine.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/CommandLine.cxx b/src/CommandLine.cxx index b3b54e735..8f29720ff 100644 --- a/src/CommandLine.cxx +++ b/src/CommandLine.cxx @@ -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; |