Why doesn't `allow_unregistered` work for me?
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 30/100
Research direction
Start with the linked source in backends/BoostArgs.cpp and trace the command_line_parser setup through options(oDesc), positional(pd), and allow_unregistered(). Reproduce the run() failure with the shown rawArgs, then determine why the positional limit is exceeded; done means the intended unregistered arguments no longer trigger this exception.
Written by the indexing model from the issue text.
Description
I still get too many positional options have been specified on the command line on run()
The excerpt
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
- Dominant language
- C++
- Stars
- 136
- Forks
- 117
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/program_options
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
boostorg/program_options#147 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
boostorg/program_options#146 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
boostorg/program_options#144 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
boostorg/program_options#142 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
boostorg/program_options#139 ·
All issues in boostorg/program_options
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·