boostorg / boostorg/program_options

Why doesn't `allow_unregistered` work for me?

Open
#113 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
136
Forks
117
PR merge metrics
No merged PRs in 30d

Description

I still get `too many positional options have been specified on the command line` on `run()`

The excerpt

```c++
boost::program_options::variables_map vm;
try{
auto parsed = boost::program_options::command_line_parser(rawArgs.argc, rawArgs.argv).options(oDesc).positional(pd).allow_unregistered().run(); //too many positional options have been specified on the command line
boost::program_options::store(parsed, vm);
boost::program_options::notify(vm);
auto rest = boost::program_options::collect_unrecognized(parsed.options, boost::program_options::collect_unrecognized_mode::include_positional);
} catch(std::exception &ex) {
PROCESS_CASE_OF_SYNTAX_ERROR_WHATABLE_EXCEPTION(ex);
}
```

The full source is here: https://github.com/HydrArgs/HydrArgs/blob/master/backends/BoostArgs.cpp

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.