util/OptionParser: collect remaining arguments

Allow the caller to use a simple "for" loop without checking
arguments.
This commit is contained in:
Max Kellermann
2018-01-16 11:03:04 +01:00
parent 0066f7a818
commit 68f660dbcc
3 changed files with 13 additions and 10 deletions

View File

@@ -53,7 +53,9 @@ OptionParser::ParseNext() noexcept
option_raw = arg;
return true;
}
option = nullptr;
option_raw = nullptr;
*remaining_tail++ = arg;
return false;
}