Opened 16 years ago
Closed 15 years ago
#898 closed Bugs (fixed)
[program_options] improper guess
Reported by: | alexis_wilke | Owned by: | Vladimir Prus |
---|---|---|---|
Milestone: | Component: | None | |
Version: | None | Severity: | Showstopper |
Keywords: | Cc: |
Description
I found a problem in the program_options when using the allow_guessing style (which is the default). The option_description::match() function (boost_1_33_1/libs/program_options/src/options_description.cpp) checks option names approximatively only if the allow_guessing is turned on. The match() function needs to return three values: definitively not this option, definitively this option or maybe this option. In the first case, you try the next option (see options_description::find_nothrow() in the same file). In the second case, you return with that very option. In the third case, you try the next options. If at the very end, you did not find a definitive option and you found more than 2 matching approximetly, then you generate the error (more than one approx. matched!). And if nothing matched, you generate that other error. This is only partially fixed in Debian and I'm attaching that fix below. The problem in the Debian fix is that if the valid full definitive option is to be found AFTER two other partial options, it also breaks (duh! am I the only one to understand this logic?! it seems so simple!) I did not understand the 1.34.0 yet and thus I did not see the fix there...
Change History (2)
comment:2 by , 15 years ago
Resolution: | None → fixed |
---|---|
Severity: | → Showstopper |
Status: | assigned → closed |
Fixed in CVS HEAD. I've used slightly different code solution, but thanks for the patch anyway!
Note:
See TracTickets
for help on using tickets.