boostorg / boostorg/program_options

canonical_name option for error_with_option_name is giving NULL string

Open
#102 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

The error is "option is ambiguous and matches 'parent_run' and 'parent_hierarchy' " instead it should be "option '-parent' is ambiguous and matches '-parent_run' and '-parent_hierarchy' " Here since -parent is canonical name and it set to NULL string , it is giving the first error message. I have checked the canonical name using get_canonical_name function.
Below is the code snippet.
catch(boost::program_options::error& e){
std::cout<

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the ambiguity error with the shown program_options catch and trace the get_canonical_name function mentioned in the report. Confirm whether the canonical name becomes a NULL string, then verify that the completed behavior includes '-parent' and both matching option names in the error message. The payload names no source file or test path.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.