Commit Graph

1 Commits

Author SHA1 Message Date
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