To reproduce:
int main(int argc, char *argv[])
{
argparse::ArgumentParser program("program_name");
program.add_argument("--foo")
.default_value(1)
try {
program.parse_args(argc, argv);
} catch (const std::exception& err) {
std::cerr << err.what() << std::endl;
std::cerr << program;
std::exit(1);
}
}
$ ./example --foo 1 --foo 1
Duplicate argument --foo
...
The parser should simply accept the last value of the argument, to match the behavior of the majority of other argument parsers