Commit Graph

475 Commits

Author SHA1 Message Date
Vladimir Prus
bc0c90a70f Merge branch 'develop' 2018-07-06 17:35:40 +03:00
Vladimir Prus
d95d316848 fix msvc 10 error. 2018-07-06 17:35:12 +03:00
Emre Turkay
0410ddcbd2 Pull back cpp file change of default template value definition for parse_config_file. 2018-07-06 10:38:43 +03:00
Emre Turkay
64c3ae0fde Specified a default value for the template argument of parse_config_file. 2018-07-06 10:38:43 +03:00
Vladimir Prus
331ed69055 Merge branch 'develop' 2018-07-06 10:36:17 +03:00
Vladimir Prus
a2cbe31bef fix typo 2018-07-06 10:34:49 +03:00
Vladimir Prus
46ad442da1 Merge branch 'develop' 2018-06-27 22:32:29 +03:00
Eyal Rozenberg
589d55837e Fixes #1: Support for multiple long names per option
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
2018-06-27 22:25:43 +03:00
Vladimir Prus
4b81beaaa9 Disable usbsan.
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.
2018-06-14 15:02:07 +03:00
Vladimir Prus
bacc983235 Disable examples that use C++11 features. 2018-06-14 13:57:17 +03:00
James E. King, III
7d495841ed Fix mention of date_time in the readme 2018-05-14 17:59:01 +03:00
Daniel James
646cc20a54 Fix the documentation build 2018-03-23 11:26:22 +03:00
Tom Kent
9bf97405dc Additional examples (#21)
* 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
2018-03-22 18:29:58 +03:00
Vladimir Prus
491cb17e3a Fix uninitialized validation_error::m_kind. 2018-03-16 12:35:57 +03:00
Vladimir Prus
d295fcca69 Disable coverity, since they appear to have some problems. 2018-03-15 22:58:22 +03:00
Vladimir Prus
f955bd6b9f
Update appveyor master badge. 2018-03-15 22:52:02 +03:00
Vladimir Prus
46caf622db Merge branch 'develop' 2018-03-15 22:21:23 +03:00
Vladimir Prus
168f96934f
Change appveyor badge url 2018-03-15 22:13:25 +03:00
Vladimir Prus
a561f71e84
Make build status links point to program_options 2018-03-12 01:37:17 +03:00
Vladimir Prus
c2f064650d
Add CI status table 2018-03-12 01:34:51 +03:00
James E. King III
5ae515c5b3 add ci bits and readme 2018-03-12 01:26:55 +03:00
Kohei Takahashi
84d5b35261 Compile error with initializer list on c++03 2018-03-06 22:35:28 +03:00
Peter Dimov
ec3aded08e Add quick test target (for CI) 2017-12-02 18:38:20 +02:00
Vladimir Prus
046501c191 Fix member hiding warnings.
Fixes #35.
2017-10-25 16:24:36 +03:00
Sylvain Joubert
4f52423dca Remove extra parens in boost::optional how-to example 2017-10-12 14:28:57 +03:00
Tatsuyuki Ishi
110772c0ac Simplify vector initialization 2017-07-24 22:34:59 +03:00
Johannes Spangenberg
fcee593529 fix suppressing I/O error in parse_config_file
corresponding issue: https://svn.boost.org/trac10/ticket/13125
2017-07-24 22:22:31 +03:00
Vladimir Prus
d9ef3853c6 Merge branch 'develop' 2017-07-24 21:48:56 +03:00
Vladimir Prus
d164a20bc9 Additional test for error reporting.
Closes #30.
2017-07-24 21:48:04 +03:00
Vladimir Prus
3e1d2603e6 Fix out-of-range error
Closes #31.
2017-07-21 18:30:47 +03:00
Vladimir Prus
acaa4c94e1 Merge branch 'develop' 2017-06-25 21:41:31 +03:00
Vladimir Prus
a30cc1082f Feature macro for use-next-token-for-implicit-option behaviour. 2017-06-25 21:39:43 +03:00
Vladimir Prus
0565d1ee16 Merge from develop for 1.65.0
- 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.
2017-06-24 20:06:06 +03:00
Vladimir Prus
b35e654335 Update comments. 2017-06-10 22:44:09 +03:00
Vladimir Prus
ed72cc2f92 Add tests for the current implicit_value behaviour. 2017-06-10 22:44:09 +03:00
Vladimir Prus
c83abc21a0 Correct documentation for 'implicit_value'
Now we no longer say it requires value to be in the same
token.
2017-06-10 22:44:09 +03:00
Vladimir Prus
7729850bb7 Make options with implicit value use next token.
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.
2017-06-10 22:44:09 +03:00
jzmaddock
5dc325580b Namespace fix for diab (EDG) compiler
Extracted from Boost.Config issue: https://svn.boost.org/trac/boost/ticket/11655.
2017-04-17 00:00:32 +03:00
Edward Catmur
3277249932 Support boost::optional option variables. 2016-12-21 13:18:47 +03:00
Isaac Dupree
1c2472b8d7 fix syntax with BOOST_NO_EXCEPTIONS 2016-12-21 11:05:00 +03:00
Vladimir Prus
1f9413f532 Switch to using boost-lib. 2016-10-28 13:57:12 +03:00
Rene Rivera
abbb5c12a6 Add, and update, documentation build targets. 2016-10-10 11:39:52 -05:00
Rene Rivera
dfdbcfca0f Add, and update, documentation build targets. 2016-10-07 23:07:35 -05:00
Gaurav
5a85b81fcf get_option_name() can throw std::logic_error
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    }
2015-10-06 09:43:09 +03:00
Vladimir Prus
8ca8b3957a Fix code duplication. 2015-09-12 21:51:31 +03:00
Vladimir Prus
a495b0210a Initialize position_key in second basic_option constructor. 2015-09-11 22:15:32 +03:00
Vladimir Prus
fae2d4c57b Merge from develop for 1.59
- 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)
2015-06-09 09:54:19 +03:00
Vladimir Prus
c0cee7f6da Go back to std::type_info in one more place. 2015-05-03 21:55:08 +03:00
Vladimir Prus
0756d35f8b Remove more unnecessary use of boost::type_index. 2015-05-01 19:15:36 +03:00
Vladimir Prus
bd1d0bd861 Put back std::type_info.
Since typed_value_base is only used with RTTI on, there's
no need to avoid std::type_info there.
2015-04-30 22:15:31 +03:00