An unintrusive implementation - no existing interfaces changed, and a single addition for obtaining all of the different long names.
Notes:
* Tests added for the new functionality, and existing tests expanded to take it into account.
* It is now impossible to specify long names with commas in them (but then, that wasn't properly supported before either, more of an oversight).
* The multiple long options are not included in the usage information - just the first one of them is printed
It presently fails like this:
/usr/bin/ld: unrecognized option '--push-state--no-as-needed'
/usr/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
"g++-7" -o "../../bin.v2/libs/program_options/test/gcc-7/debug/cxxstd-03-iso/link-static/test_convert"
-Wl,--start-group
"../../bin.v2/libs/program_options/test/gcc-7/debug/cxxstd-03-iso/link-static/test_convert.o"
"../../bin.v2/libs/program_options/build/gcc-7/debug/cxxstd-03-iso/link-static/libboost_program_options.a"
-Wl,-Bstatic -Wl,-Bdynamic -Wl,--end-group -m64 -std=c++03 -g -fno-sanitize-recover=undefined -fsanitize=undefined
This error seems like some misconfiguration of compiler install, not something I can fix.
* Added multiple inputs to example
In the section after the introduction of using value<vector<...>> to store
multiple values, I updated the example to show multiple input values and their
results.
* Make it clear how to enable sections for ini files
It was unclear how the user should support sections, should they have nested options_description's (no), nested variables_map's (no), it is just a dotted string that is input! This adds a snippet showing that.
* Added an example for environment options
This example shows how to use program_options to pull environmental options
into a program. This instance uses a function to map env options to config
options.
* Added an example showing different types in a config file
I went through a lot of the common types that a user may want to include in
a config file (especially the boolean options) and showed an example with
them all.
With some minor modifications, this could also be added to the tests directory
as there are several cases in here that I didn't see checked anywhere else in
the code.
* Added explanation comments to new examples
* Added an example with a heirarchy of inputs
This file shows an example program that can get inputs from the command line,
environmental variables, multiple config files specified on the command line,
and a default config file. There are multiple usage examples at the bottom in
the comments.
* Reference to example showing environment options
* Added section detailing type conversion.
Added explicity acknowledging that hex/oct/bin formatted strings aren't allowed.
Detailed the bool_switch value and what strings evaluate true/false.
* Added a global to the config file example
* Semicolon typo
* Split components into seperate functions
* Added unregistered entry and flag to prevent error
* Added logic to capture unregistered value
* Build new examples
* Backslashes need escaping on unix
* match permissions
- Make options with implicit value use next token, like it did
before.
- Support boost::optional option variables.
- Fix syntax error with BOOST_NO_EXCEPTIONS
- Fix uninitlized position_key in some cases.
This commit reverts:
- 88dea3c6fd.
"Stop options with implicit value from consuming separate tokens."
- 0c01e9aadc.
"Add testing for implicit_values and non-consuming of separate tokens."
These commits from 2014 made options with implicit_value set only
consult value in the same token. The problem is that now implicit_value,
a sematic properly, forces a particular syntax, which proved to be
confusing.
get_option_name() calls get_canonical_option_prefix() which throws in file value_semantic.cpp line no 296
296 throw std::logic_error("error_with_option_name::m_option_style can only be "
297 "one of [0, allow_dash_for_short, allow_slash_for_short, "
298 "allow_long_disguise or allow_long]");
299 }
- Fix compilation errors, missing dllexport and warnings on
Windows and/or MSVC (Daniela Engert, Marcel Raad)
- Fix unintialized fields (Zoey Greer)
- Stop options with implicit value from consuming separate tokens (Michael John Decker)
- Make multitoken limit be max int, not 32K (Hans Hohenfeld)
- Code formatting and documentation fixes (Jurko, Lauri Nurmi)
- Minimal support for no-rtti build (Minmin Gong)
- Don't increment environment pointer past the end (Vladimir Prus)