Go to file
Baptiste Wicht 5492f17969 Add some getter
* Get list of groups
 * Get help details for groups
2014-10-30 18:14:08 +01:00
src Add some getter 2014-10-30 18:14:08 +01:00
.gitignore add gitignore 2014-09-27 17:05:23 +10:00
CMakeLists.txt unicode configuration 2014-10-27 22:06:24 +11:00
INSTALL add install file 2014-10-13 09:20:20 +11:00
LICENSE adds a simple license file 2014-10-14 11:40:16 +02:00
README update TODO list 2014-10-21 09:27:24 +11:00

== Quick start ==

This is a lightweight C++ option parser library, supporting the standard GNU
style syntax for options.

Options can be given as:

    --long
    --long=argument
    --long argument
    -a
    -ab
    -abc argument

where c takes an argument, but a and b do not.

How to use:

    #include <cxxopts.hpp>

Create a cxxopts::Options instance.

    cxxopts::Options options;

Then use add_options.

    options.add_options()
      ("d,debug", "Enable debugging")
      ("f,file", "File name", cxxopts::value<std::string>())

Options can be declared with a short and/or long option. A description must be
provided. The third argument is the value, if omitted it is boolean. Any type
can be given as long as it can be parsed, with operator>>.

To parse the command line do:

    options.parse(argc, argv);

To retrieve an option use options.count("option") to get the number of times
it appeared, and

    options["opt"].as<type>()

to get its value. If "opt" doesn't exist, or isn't of the right type, then an
exception will be thrown.

== Linking ==

This is a header only library.

== Requirements ==

The only build requirement is a C++ compiler that supports C++11 regular 
expressions. For example GCC >= 4.9 or clang with libc++.


== TODO list ==

* Allow unrecognised options.
* Various help strings.
* Unicode aware for help strings.