@@ -42,8 +42,8 @@ and instead can write only the help message--*the way you want it*.
4242
4343 int main(int argc, const char** argv)
4444 {
45- std::map<std::string, docopt::value> args
46- = docopt::docopt(USAGE,
45+ std::map<std::string, docopt::value> args
46+ = docopt::docopt(USAGE,
4747 { argv + 1, argv + argc },
4848 true, // show help if requested
4949 "Naval Fate 2.0"); // version string
@@ -78,7 +78,10 @@ to work with docopt:
7878- GCC 4.9
7979- Visual C++ 2015 RC
8080
81- Note that GCC-4.8 will not work due to its missing the ``regex `` module.
81+ GCC-4.8 can work, but the std::regex module needs to be replaced with ``Boost.Regex ``.
82+ In that case, you will need to define ``DOCTOPT_USE_BOOST_REGEX `` when compiling
83+ docopt, and link your code with the appropriated Boost libraries. A relativley
84+ recent version of Boost is needed: 1.55 works, but 1.46 does not for example.
8285
8386This port is licensed under the MIT license, just like the original module.
8487However, we are also dual-licensing this code under the Boost License, version 1.0,
@@ -92,8 +95,8 @@ The differences from the Python port are:
9295* a ``docopt::value `` type to hold the various value types that can be parsed.
9396 We considered using boost::variant, but it seems better to have no external
9497 dependencies (beyond a good STL).
95- * because C++ is statically-typed and Python is not, we had to make some
96- changes to the interfaces of the internal parse tree types.
98+ * because C++ is statically-typed and Python is not, we had to make some
99+ changes to the interfaces of the internal parse tree types.
97100* because ``std::regex `` does not have an equivalent to Python's regex.split,
98101 some of the regex's had to be restructured and additional loops used.
99102
126129- ``argv `` is a vector of strings representing the args passed. Although
127130 main usually takes a ``(int argc, const char** argv) `` pair, you can
128131 pass the value ``{argv+1, argv+argc} `` to generate the vector automatically.
129- (Note we skip the argv[0] argument!) Alternatively you can supply a list of
132+ (Note we skip the argv[0] argument!) Alternatively you can supply a list of
130133 strings like ``{ "--verbose", "-o", "hai.txt" } ``.
131134
132135- ``help ``, by default ``true ``, specifies whether the parser should
155158 compatibility with POSIX, or if you want to dispatch your arguments
156159 to other programs.
157160
158- The **return ** value is a ``map<string, docopt::value> `` with options,
159- arguments and commands as keys, spelled exactly like in your help message.
161+ The **return ** value is a ``map<string, docopt::value> `` with options,
162+ arguments and commands as keys, spelled exactly like in your help message.
160163Long versions of options are given priority. For example, if you invoke the
161164top example as::
162165
@@ -372,7 +375,7 @@ We have an extensive list of `examples
372375every aspect of functionality of **docopt **. Try them out, read the
373376source if in doubt.
374377
375- There are also very intersting applications and ideas at that page.
378+ There are also very intersting applications and ideas at that page.
376379Check out the sister project for more information!
377380
378381Subparsers, multi-level help and *huge * applications (like git)
@@ -397,7 +400,7 @@ a C++ test case runner (run_testcase.cpp)::
397400
398401 $ clang++ --std=c++11 --stdlib=libc++ docopt.cpp run_testcase.cpp -o run_testcase
399402 $ python run_tests.py
400- PASS (175)
403+ PASS (175)
401404
402405You can also compile the example shown at the start (included as example.cpp)::
403406
@@ -424,10 +427,10 @@ You can also compile the example shown at the start (included as example.cpp)::
424427Development
425428---------------------------------------------------
426429
427- Comments and suggestions are *very * welcome! If you find issues, please
430+ Comments and suggestions are *very * welcome! If you find issues, please
428431file them and help improve our code!
429432
430- Please note, however, that we have tried to stay true to the original
433+ Please note, however, that we have tried to stay true to the original
431434Python code. If you have any major patches, structural changes, or new features,
432435we might want to first negotiate these changes into the Python code first.
433436However, bring it up! Let's hear it!
@@ -439,4 +442,3 @@ Changelog
439442first release with stable API will be 1.0.0 (soon).
440443
441444- 0.6.1 The initial C++ port of docopt.py
442-
0 commit comments