Skip to content

Release 3.2.0

Choose a tag to compare

@gavinsalam gavinsalam released this 30 Nov 16:17
· 22 commits to master since this release

new features

  • when there are multiple forms of an option, instead of
    any_value<T>({"-l,"--long"}), one can now simply use
    value<T>({"-l","--long"}) to get the same effect.
    This is the preferred option.

  • added CmdLine::value_bool("-opt",true/false) option, which can process
    -opt true/false (or yes/no, on/off, 1/0), as well as simply -opt and -no-opt
    and returns true/false accordingly.

  • name demangling is enabled via cxxabi.h if CmdLine.cc is compiled with
    -DCMDLINE_ENABLE_DEMANGLE. This is useful for printing out type
    names in the help output.

  • subsections now possible, with CmdLine::start_subsection(...)

  • sections and subsections can have descriptions, which are printed out
    in the help text -- just add a second argument to the
    start_[sub]section call.

  • as well as overloading operator<< to obtain conversions to
    specific types, the user has the option of specialising the
    static template function T CmdLine_string_to_value<T>(...),
    which can be used as a last-resort for types where overloading
    operator<< is not an option.

  • this has been used to enable cmdline.value<bool> to handle
    various inputs (true/false, on/off, 1/0, yes/no)

  • unit-tests.cc has now been added to check various behaviours;
    can be invoked with make check

  • added markdown formatted help, printed out with --markdown-help (or
    -markdown-help), together with the CmdLine::markdown_help_requested()
    enquiry function.

  • CmdLine::Result<T>::choices() can now take a second argument with a
    vector of help strings, one per valid choice. These are then printed
    out in the various help formats

other changes

  • CmdLine::section() and help_requested() members, to return current section
    and help requested status
  • CmdLine::section(...) as a shorthand for setting the section (similar subsection()...)
  • small improvements in doxygen output
  • CmdLine::dump(...) now takes an optional third argument to specify the prefix
    for each option with a well-defined value.