Skip to content

Module: Argument Parser

Hannes Hauswedell edited this page Jan 23, 2017 · 19 revisions

Links:

Possible interface:

addOption(char const shortID,         // -o
          std::string const & longID, // --output
          TValue & savePlace,         // myOptions.outputFile (std::string)
          std::function<bool(TValue const&)> && validator = [] (TValue const&) { return true; } );

savePlace would be an existing variable that also defines the type of the argument. savePlace can be set to a default value upon definition/creation / outside of the addArgument function. validator is a callable that verifies the argument. It can be user-specified, but there shall be pre-defined validators for integral ranges (takes a pair of integral) or file extensions (takes a container of std::string).

Clone this wiki locally