wibble
1.1
|
Parser for commandline arguments, with builting help functions and manpage generation, and requiring a mandatory command. More...
#include <parser.h>
Public Member Functions | |
StandardParserWithMandatoryCommand (const std::string &appname, const std::string &version, int section, const std::string &author) | |
bool | parse (int argc, const char *argv[]) |
![]() | |
StandardParserWithManpage (const std::string &appname, const std::string &version, int section, const std::string &author) | |
bool | parse (int argc, const char *argv[]) |
![]() | |
StandardParser (const std::string &appname, const std::string &version) | |
void | outputHelp (std::ostream &out) |
bool | parse (int argc, const char *argv[]) |
![]() | |
Parser (const std::string &name, const std::string &usage=std::string(), const std::string &description=std::string(), const std::string &longDescription=std::string()) | |
bool | parse (int argc, const char *argv[]) |
Parse the commandline. More... | |
bool | hasNext () const |
std::string | next () |
![]() | |
const std::string & | name () const |
Option * | add (Option *o) |
Add an Option to this engine. More... | |
OptionGroup * | add (OptionGroup *group) |
Add an OptionGroup to this engine. More... | |
Engine * | add (Engine *o) |
Add a Engine to this engine. More... | |
template<typename T > | |
T * | create (const std::string &name, char shortName, const std::string &longName, const std::string &usage=std::string(), const std::string &description=std::string()) |
Create an option. More... | |
template<typename T > | |
T * | add (const std::string &name, char shortName, const std::string &longName, const std::string &usage=std::string(), const std::string &description=std::string()) |
Create an option and add to this engine. More... | |
OptionGroup * | createGroup (const std::string &description) |
Create an OptionGroup. More... | |
OptionGroup * | addGroup (const std::string &description) |
Create an OptionGroup and add it to this engine. More... | |
Engine * | createEngine (const std::string &name, const std::string &usage=std::string(), const std::string &description=std::string(), const std::string &longDescription=std::string()) |
Create a Engine. More... | |
Engine * | addEngine (const std::string &name, const std::string &usage=std::string(), const std::string &description=std::string(), const std::string &longDescription=std::string()) |
Create a Engine and add it to this engine as a command. More... | |
const std::vector< OptionGroup * > & | groups () const |
Get the OptionGroups that have been added to this engine. More... | |
const std::vector< Option * > & | options () const |
Get the Options that have been added to this engine. More... | |
const std::vector< Engine * > & | commands () const |
Get the Engines that have been added to this engine. More... | |
Engine * | command (const std::string &name) const |
bool | hasOptions () const |
Returns true if this Engine has options to parse. More... | |
Engine * | foundCommand () const |
Return the command that has been found in the commandline, or NULL if none have been found. More... | |
void | dump (std::ostream &out, const std::string &prefix=std::string()) |
![]() | |
virtual | ~Managed () |
Public Attributes | |
Engine * | helpCommand |
![]() | |
StringOption * | manpage |
![]() | |
OptionGroup * | helpGroup |
BoolOption * | help |
BoolOption * | version |
Additional Inherited Members | |
![]() | |
void | addWithoutAna (Option *o) |
void | addWithoutAna (const std::vector< Option * > &o) |
void | add (const std::string &alias, Engine *o) |
void | rebuild () |
std::pair< ArgList::iterator, bool > | parseFirstIfKnown (ArgList &list, ArgList::iterator begin) |
Handle the commandline switch at 'begin'. More... | |
ArgList::iterator | parseKnownSwitches (ArgList &list, ArgList::iterator begin) |
Parse all known Options and leave the rest in list. More... | |
ArgList::iterator | parseList (ArgList &list) |
Parse the list of arguments, starting at the beginning and removing the arguments it successfully parses. More... | |
ArgList::iterator | parse (ArgList &list, ArgList::iterator begin) |
Parse all the switches in list, leaving only the non-switch arguments or the arguments following "--". More... | |
Engine (MemoryManager *mman=0, const std::string &name=std::string(), const std::string &usage=std::string(), const std::string &description=std::string(), const std::string &longDescription=std::string()) | |
![]() | |
int | m_section |
std::string | m_author |
Parser for commandline arguments, with builting help functions and manpage generation, and requiring a mandatory command.
|
inline |
References wibble::commandline::Engine::addEngine(), and helpCommand.
bool wibble::commandline::StandardParserWithMandatoryCommand::parse | ( | int | argc, |
const char * | argv[] | ||
) |
References wibble::commandline::Help::outputHelp().
Referenced by withCommands().
Engine* wibble::commandline::StandardParserWithMandatoryCommand::helpCommand |
Referenced by StandardParserWithMandatoryCommand().