Class base_cli

Class Documentation

class base_cli

Base class for command line interfaces. Uses boost to do the actual parsing.

Public Functions

explicit base_cli(const std::string &mnemonic = "")
virtual ~base_cli(void) = default
inline bpo::options_description *desc(void)

Get a handle on the options description.

Returns:

The variables map handle.

status_t parse(int argc, char **argv)

Parse command line options.

Parameters:
  • argc – The argc from main().

  • argv – The argv from main().

Returns:

status_t.

void print(void)

Print all options and their help to stdout.

inline const std::string &prog_name(void)

Get the program name.

Returns:

The program name.

inline virtual bool validate(void)

Determine if parameters passed are valid, by some criterion.

Returns:

TRUE if the condition is met, and FALSE otherwise.

inline const bpo::variables_map &vm(void)

Get a handle on the variables map.

Returns:

The variables map handle.