Boolean option.
More...
#include <options.h>
|
| BoolOption (const std::string &name) |
|
| BoolOption (const std::string &name, char shortName, const std::string &longName, const std::string &usage=std::string(), const std::string &description=std::string()) |
|
virtual ArgList::iterator | parse (ArgList &, ArgList::iterator begin) |
| Parse the next commandline parameter after the short form of the command has been found. More...
|
|
virtual bool | parse (const std::string &) |
| Parse the commandline parameter of a long commandline switch. More...
|
|
virtual void | parse_noarg () |
| Notify that the option is present in the command line, but has no arguments. More...
|
|
Protected Member Functions inherited from wibble::commandline::Option |
| Option (const std::string &name) |
|
| Option (const std::string &name, char shortName, const std::string &longName, const std::string &usage=std::string(), const std::string &description=std::string()) |
|
virtual bool | arg_is_optional () const |
| Return true if the argument to this function can be omitted. More...
|
|
wibble::commandline::BoolOption::BoolOption |
( |
const std::string & |
name) | |
|
|
inlineprotected |
wibble::commandline::BoolOption::BoolOption |
( |
const std::string & |
name, |
|
|
char |
shortName, |
|
|
const std::string & |
longName, |
|
|
const std::string & |
usage = std::string() , |
|
|
const std::string & |
description = std::string() |
|
) |
| |
|
inlineprotected |
bool wibble::commandline::BoolOption::boolValue |
( |
) | |
const |
|
inline |
Referenced by TestCommandlineEngine::clusteredShortOpts(), TestCommandlineEngine::commandsWithoutCommand(), TestCommandlineEngine::commandsWithOverlappingArgs(), TestCommandlineEngine::commandWithArg(), TestCommandlineEngine::creationShortcuts(), TestCommandlineEngine::longOptsWithArgs(), TestCommandlineEngine::longOptsWithDashes(), TestCommandlineEngine::noSwitchesAfterFirstArg(), TestCommandlineEngine::optsAndArgs(), TestCommandlineEngine::optsOnly(), and withCommands().
virtual ArgList::iterator wibble::commandline::BoolOption::parse |
( |
ArgList & |
list, |
|
|
ArgList::iterator |
begin |
|
) |
| |
|
inlineprotectedvirtual |
Parse the next commandline parameter after the short form of the command has been found.
It may or may not remove the parameter from the list, depending on if the option wants a value or not.
Signal that the option has been found, with the given argument (or 0 if no argument).
- Returns
- true if it used the argument, else false
Implements wibble::commandline::Option.
References wibble::list::begin(), and parse_noarg().
virtual bool wibble::commandline::BoolOption::parse |
( |
const std::string & |
param) | |
|
|
inlineprotectedvirtual |
virtual void wibble::commandline::BoolOption::parse_noarg |
( |
) | |
|
|
inlineprotectedvirtual |
std::string wibble::commandline::BoolOption::stringValue |
( |
) | |
const |
|
inline |
The documentation for this class was generated from the following file: