Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3423: Diagnostic of errors.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-11-24 05:55:39
#3423: Diagnostic of errors.
---------------------------------------------+------------------------------
Reporter: Alex Bukreev <bucreev@â¦> | Owner: vladimir_prus
Type: Feature Requests | Status: reopened
Milestone: Boost 1.41.0 | Component: program_options
Version: Boost 1.40.0 | Severity: Problem
Resolution: | Keywords:
---------------------------------------------+------------------------------
Changes (by Alex Bukreev <bucreev@â¦>):
* status: closed => reopened
* resolution: fixed =>
Comment:
Iâve looked through your changes.
There are 12 classes declared in file âerrors.hppâ.
1. class âerrorâ â base class, exception in this class are not generated
(i suggest to declare its constructor as âprotectedâ).
2. class âinvalid_syntaxâ â there is a âmsgâ parameter of type âstringâ
which is specified in constructor, it is necessary to swap its parameter
type to âenumâ with storing of its value (like itâs done in class
âinvalid_command_line_syntaxâ).
3. class âunknown_optionâ â ok.
4. class âambiguous_optionâ - â there is a ânameâ parameter specified in
constructor. Parameter value must be stored.
5. class "multiple_values" - there is a âwhatâ parameter specified in
constructor which is always equal to "multiple_values" parameter.
- remove âwhatâ parameter from constructor.
6. class "multiple_occurrences" - there is a âwhatâ parameter specified in
constructor which is always equal to "multiple_values" parameter.
- remove âwhatâ parameter from constructor.
7. class "validation_error - there is a âwhatâ parameter of type âstringâ
specified in constructor. It is necessary to swap its parameter type to
âenumâ with storing of its value.
8. class "invalid_option_value" - value of parameter "bad_value" is not
stored.
9. class "too_many_positional_options_error" â if this exception may occur
only because of programmer(not user) mistake, then itâs ok.
10. class "too_few_positional_options_error" - if this exception may occur
only because of programmer(not user) mistake, then itâs ok.
11. class "invalid_command_line_syntax" â ok
12. class "invalid_command_line_style" - if this exception may occur only
because of programmer(not user) mistake, then itâs ok.
While testing of âerrorâ classes were detected the following:
1.Source one:
options_description desc;
desc.add_options()
("cfgfile,c", value<string>()->multitoken(), "the config file")
("output,c", value<string>(), "the output file")
("output,o", value<string>(), "the output file")
;
const char* cmdline[] = {"program", "-c", "file", "-o", "anotherfile"};
No mistake detected!!!
2.Source two:
desc.add_options()
("cfgfile,c", value<string>()->multitoken(), "the config file")
("output,o", value<string>(), "the output file")
;
const char* cmdline[] = {"program", "-c", "-o", "anotherfile"};
Wrong diagnostic: "in option 'cfgfile': multiple values not allowed"
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3423#comment:5> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC