Commit 1364746
authored
Fix the order of arguments in command-line parsing error message (#1158)
CLI11 code prints the command-line arguments in reversed order in the
error message.
Code to reproduce:
```c++
#include <string>
#include <CLI/CLI.hpp>
int main(int argc, const char **argv)
{
CLI::App app{"Bug report app"};
std::string foo;
app.add_option("--foo", foo, "Foo option");
CLI11_PARSE(app, argc, argv);
return 0;
}
```
Reproduction:
```
$ g++ -Wall -Wextra -I CLI11/include/ cli11-bug-order-in-error.cpp -o cli11-bug-order-in-error && ./cli11-bug-order-in-error --foo bar --fizz buzz
The following arguments were not expected: buzz --fizz
Run with --help for more information.
```
Expected result:
```
The following arguments were not expected: --fizz buzz
Run with --help for more information.
```1 parent c31476b commit 1364746
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
| 313 | + | |
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
| 319 | + | |
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| |||
0 commit comments