Skip to content

Commit 46ad442

Browse files
committed
Merge branch 'develop'
2 parents 46caf62 + 589d558 commit 46ad442

19 files changed

+1522
-183
lines changed

.travis.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -114,21 +114,6 @@ jobs:
114114
script:
115115
- libs/$SELF/ci/cppcheck.sh
116116

117-
- os: linux
118-
env:
119-
- COMMENT=UBSAN
120-
- B2_VARIANT=variant=debug
121-
- TOOLSET=gcc-7
122-
- CXXFLAGS="cxxflags=-fno-omit-frame-pointer cxxflags=-fsanitize=undefined cxxflags=-fno-sanitize-recover=undefined"
123-
- LINKFLAGS="linkflags=-fsanitize=undefined linkflags=-fno-sanitize-recover=undefined"
124-
- UBSAN_OPTIONS=print_stacktrace=1
125-
addons:
126-
apt:
127-
packages:
128-
- g++-7
129-
sources:
130-
- ubuntu-toolchain-r-test
131-
132117
- os: linux
133118
env:
134119
- COMMENT=CodeCov
@@ -154,17 +139,6 @@ jobs:
154139
# - CXXSTD=03,11
155140

156141
#################### Jobs to run on pushes to master, develop ###################
157-
158-
# Coverity Scan
159-
- os: linux
160-
if: (branch IN (develop, master)) AND (type IN (cron, push))
161-
env:
162-
- COMMENT="Coverity Scan"
163-
- TOOLSET=gcc
164-
script:
165-
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
166-
- cd libs/$SELF
167-
- ci/coverity.sh
168142

169143
notifications:
170144
email:

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ Distributed under the [Boost Software License, Version 1.0](http://www.boost.org
1212
### Build Status
1313
(in progress...)
1414

15-
|Branch | Travis | Appveyor | Coverity Scan | codecov.io | Deps | Docs | Tests |
16-
|:-------------: | ------ | -------- | ------------- | ---------- | ---- | ---- | ----- |
17-
|[`master`](https://github.com/boostorg/program_options/tree/master) | [![Build Status](https://travis-ci.org/boostorg/program_options.svg?branch=master)](https://travis-ci.org/boostorg/program_options) | [![Build status](https://ci.appveyor.com/api/projects/status/upf5c528fy09fudk?svg=true)](https://ci.appveyor.com/project/jeking3/date-time-1evbf) | [![Coverity Scan Build Status](https://scan.coverity.com/projects/14908/badge.svg)](https://scan.coverity.com/projects/boostorg-program_options) | [![codecov](https://codecov.io/gh/boostorg/program_options/branch/master/graph/badge.svg)](https://codecov.io/gh/boostorg/program_options/branch/master) | [![Deps](https://img.shields.io/badge/deps-master-brightgreen.svg)](https://pdimov.github.io/boostdep-report/master/program_options.html) | [![Documentation](https://img.shields.io/badge/docs-master-brightgreen.svg)](http://www.boost.org/doc/libs/master/doc/html/program_options.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-master-brightgreen.svg)](http://www.boost.org/development/tests/master/developer/program_options.html)
18-
|[`develop`](https://github.com/boostorg/program_options/tree/develop) | [![Build Status](https://travis-ci.org/boostorg/program_options.svg?branch=develop)](https://travis-ci.org/boostorg/program_options) | [![Build status](https://ci.appveyor.com/api/projects/status/e0quisadwh1v7ok5/branch/develop?svg=true)](https://ci.appveyor.com/project/vprus/program-options/branch/develop) | [![Coverity Scan Build Status](https://scan.coverity.com/projects/14908/badge.svg)](https://scan.coverity.com/projects/boostorg-program_options) | [![codecov](https://codecov.io/gh/boostorg/program_options/branch/develop/graph/badge.svg)](https://codecov.io/gh/boostorg/program_options/branch/develop) | [![Deps](https://img.shields.io/badge/deps-develop-brightgreen.svg)](https://pdimov.github.io/boostdep-report/develop/program_options.html) | [![Documentation](https://img.shields.io/badge/docs-develop-brightgreen.svg)](http://www.boost.org/doc/libs/develop/doc/html/program_options.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-develop-brightgreen.svg)](http://www.boost.org/development/tests/develop/developer/program_options.html)
15+
|Branch | Travis | Appveyor | codecov.io | Deps | Docs | Tests |
16+
|:-------------: | ------ | -------- | ---------- | ---- | ---- | ----- |
17+
|[`master`](https://github.com/boostorg/program_options/tree/master) | [![Build Status](https://travis-ci.org/boostorg/program_options.svg?branch=master)](https://travis-ci.org/boostorg/program_options) | [![Build status](https://ci.appveyor.com/api/projects/status/e0quisadwh1v7ok5/branch/master?svg=true)](https://ci.appveyor.com/project/vprus/program-options/branch/master) | [![codecov](https://codecov.io/gh/boostorg/program_options/branch/master/graph/badge.svg)](https://codecov.io/gh/boostorg/program_options/branch/master) | [![Deps](https://img.shields.io/badge/deps-master-brightgreen.svg)](https://pdimov.github.io/boostdep-report/master/program_options.html) | [![Documentation](https://img.shields.io/badge/docs-master-brightgreen.svg)](http://www.boost.org/doc/libs/master/doc/html/program_options.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-master-brightgreen.svg)](http://www.boost.org/development/tests/master/developer/program_options.html)
18+
|[`develop`](https://github.com/boostorg/program_options/tree/develop) | [![Build Status](https://travis-ci.org/boostorg/program_options.svg?branch=develop)](https://travis-ci.org/boostorg/program_options) | [![Build status](https://ci.appveyor.com/api/projects/status/e0quisadwh1v7ok5/branch/develop?svg=true)](https://ci.appveyor.com/project/vprus/program-options/branch/develop) | [![codecov](https://codecov.io/gh/boostorg/program_options/branch/develop/graph/badge.svg)](https://codecov.io/gh/boostorg/program_options/branch/develop) | [![Deps](https://img.shields.io/badge/deps-develop-brightgreen.svg)](https://pdimov.github.io/boostdep-report/develop/program_options.html) | [![Documentation](https://img.shields.io/badge/docs-develop-brightgreen.svg)](http://www.boost.org/doc/libs/develop/doc/html/program_options.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-develop-brightgreen.svg)](http://www.boost.org/development/tests/develop/developer/program_options.html)
1919

2020
### Directories
2121

@@ -34,4 +34,4 @@ Distributed under the [Boost Software License, Version 1.0](http://www.boost.org
3434
* [Ask questions](http://stackoverflow.com/questions/ask?tags=c%2B%2B,boost,boost-program_options): Be sure to read the documentation first to see if it answers your question.
3535
* [Report bugs](https://github.com/boostorg/program_options/issues): Be sure to mention Boost version, platform and compiler you're using. A small compilable code sample to reproduce the problem is always good as well.
3636
* [Submit Pull Requests](https://github.com/boostorg/program_options/pulls) against the **develop** branch. Note that by submitting patches you agree to license your modifications under the [Boost Software License, Version 1.0](http://www.boost.org/LICENSE_1_0.txt). Be sure to include tests proving your changes work properly.
37-
* Discussions about the library are held on the [Boost developers mailing list](http://www.boost.org/community/groups.html#main). Be sure to read the [discussion policy](http://www.boost.org/community/policy.html) before posting and add the `[date_time]` tag at the beginning of the subject line.
37+
* Discussions about the library are held on the [Boost developers mailing list](http://www.boost.org/community/groups.html#main). Be sure to read the [discussion policy](http://www.boost.org/community/policy.html) before posting and add the `[program_options]` tag at the beginning of the subject line.

doc/overview.xml

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,13 @@ visual_bell=yes
512512
<screen>
513513
gui.accessibility.visual_bell=yes
514514
</screen>
515-
515+
<para>When the option "gui.accessibility.visual_bell" has been added to the options</para>
516+
<programlisting>
517+
options_description desc;
518+
desc.add_options()
519+
("gui.accessibility.visual_bell", value&lt;string&gt;(), "flash screen for bell")
520+
;
521+
</programlisting>
516522
</section>
517523

518524
<section>
@@ -559,12 +565,49 @@ gui.accessibility.visual_bell=yes
559565
function, any function taking a <code>std::string</code> and returning
560566
<code>std::string</code>. That function will be called for each
561567
environment variable and should return either the name of the option, or
562-
empty string if the variable should be ignored.
568+
empty string if the variable should be ignored. An example showing this
569+
method can be found in "example/env_options.cpp".
563570
</para>
564571

565572
</section>
566573
</section>
567574

575+
<section>
576+
<title>Types</title>
577+
578+
<para>Everything that is passed in on the command line, as an environmental
579+
variable, or in a config file is a string. For values that need to be used
580+
as a non-string type, the value in the variables_map will attempt to
581+
convert it to the correct type.</para>
582+
583+
<para>Integers and floating point values are converted using Boost's
584+
lexical_cast. It will accept integer values such as "41" or "-42". It will
585+
accept floating point numbers such as "51.1", "-52.1", "53.1234567890" (as
586+
a double), "54", "55.", ".56", "57.1e5", "58.1E5", ".591e5", "60.1e-5",
587+
"-61.1e5", "-62.1e-5", etc. Unfortunately, hex, octal, and binary
588+
representations that are available in C++ literals are not supported by
589+
lexical_cast, and thus will not work with program_options.</para>
590+
591+
<para>Booleans a special in that there are multiple ways to come at them.
592+
Similar to another value type, it can be specified as <code>("my-option",
593+
value&lt;bool&gt;())</code>, and then set as:</para>
594+
<screen>
595+
example --my-option=true
596+
</screen>
597+
<para>However, more typical is that boolean values are set by the simple
598+
presence of a switch. This is enabled by &bool_switch; as in <code>
599+
("other-option", bool_switch())</code>. This will cause the value to
600+
default to false and it will become true if the switch is found:</para>
601+
<screen>
602+
example --other-switch
603+
</screen>
604+
<para>When a boolean does take a parameter, there are several options.
605+
Those that evaluate to true in C++ are: "true", "yes", "on", "1". Those
606+
that evaluate to false in C++ are: "false", "no", "off", "0". In addition,
607+
when reading from a config file, the option name with an equal sign and no
608+
value after it will also evaluate to true.</para>
609+
</section>
610+
568611
<section>
569612
<title>Annotated List of Symbols</title>
570613

@@ -649,4 +692,4 @@ gui.accessibility.visual_bell=yes
649692
sgml-parent-document: ("program_options.xml" "section")
650693
sgml-set-face: t
651694
End:
652-
-->
695+
-->

doc/program_options.ent

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,5 @@
4444
<!ENTITY basic_option
4545
"<classname alt='boost::program_options::basic_option'>basic_option</classname>">
4646

47+
<!ENTITY bool_switch
48+
"<functionname alt='boost::program_options::bool_switch'>bool_switch</functionname>">

doc/tutorial.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,9 @@ Allowed options:
208208
--input-file arg : input file
209209
$ <userinput>bin/gcc/debug/options_description</userinput>
210210
Optimization level is 10
211-
$ <userinput>bin/gcc/debug/options_description --optimization 4 -I foo a.cpp</userinput>
212-
Include paths are: foo
213-
Input files are: a.cpp
211+
$ <userinput>bin/gcc/debug/options_description --optimization 4 -I foo -I another/path --include-path third/include/path a.cpp b.cpp</userinput>
212+
Include paths are: foo another/path third/include/path
213+
Input files are: a.cpp b.cpp
214214
Optimization level is 4
215215
</screen>
216216
</para>
@@ -350,4 +350,4 @@ Optimization level is 4
350350
sgml-parent-document: ("program_options.xml" "section")
351351
sgml-set-face: t
352352
End:
353-
-->
353+
-->

example/Jamfile.v2

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@ exe custom_syntax : custom_syntax.cpp ;
1212

1313
exe real : real.cpp ;
1414
exe regex : regex.cpp /boost/regex//boost_regex ;
15+
16+
# The following examples use C++ features beyond C++03.
17+
# It would be possible to make compilation of each conditional on specific config check,
18+
# for now just disable the compilation.
19+
#exe config_file_types : config_file_types.cpp ;
20+
#exe env_options : env_options.cpp ;
21+
#exe options_heirarchy : options_heirarchy.cpp ;

0 commit comments

Comments
 (0)