Command in the command line interface.
More...
#include <command.hpp>
Command in the command line interface.
Definition at line 51 of file command.hpp.
◆ Command()
◆ ~Command()
virtual Args::Command::~Command |
( |
| ) |
|
|
inlinevirtual |
◆ addArg() [1/4]
void Args::GroupIface::addArg |
( |
ArgIface & |
arg | ) |
|
|
inline |
Add argument.
- Note
- Developer should handle lifetime of the argument.
Definition at line 87 of file group_iface.hpp.
◆ addArg() [2/4]
void Args::GroupIface::addArg |
( |
ArgIface * |
arg | ) |
|
|
inline |
Add argument.
- Note
- Developer should handle lifetime of the argument.
Definition at line 93 of file group_iface.hpp.
◆ addArg() [3/4]
virtual void Args::GroupIface::addArg |
( |
ArgPtr |
arg | ) |
|
|
inlinevirtual |
◆ addArg() [4/4]
void Args::Command::addArg |
( |
ArgPtr |
arg | ) |
|
|
inlineoverridevirtual |
◆ checkCorrectnessAfterParsing()
void Args::Command::checkCorrectnessAfterParsing |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ checkCorrectnessBeforeParsing()
|
inlineoverrideprotectedvirtual |
Check correctness of the argument before parsing.
Implementation of this method must add his flag and name to the flags and names.
- Parameters
-
flags | All known flags. |
names | All known names. |
Implements Args::ArgIface.
Definition at line 366 of file command.hpp.
◆ clear()
void Args::Command::clear |
( |
| ) |
|
|
inlineoverridevirtual |
◆ defaultValue()
const String & Args::Command::defaultValue |
( |
| ) |
const |
|
inline |
◆ defaultValues()
const StringList & Args::Command::defaultValues |
( |
| ) |
const |
|
inline |
◆ description()
const String & Args::Command::description |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ findArgument()
|
inlineoverrideprotectedvirtual |
- Returns
- Argument for the given name.
- Return values
-
this | if the given name is the name of the command. |
- Note
- Doesn't look in the children.
- Parameters
-
n | Name of the argument. Can be for example "-t" or "--timeout". |
Implements Args::ArgIface.
Definition at line 286 of file command.hpp.
◆ findChild()
- Returns
- Argument for the given name.
- Return values
-
Pointer | to the ArgIface if this argument handles argument with the given name. |
nullptr | if this argument doesn't know about argument with name. |
- Note
- Looks only in children.
- Parameters
-
name | Name of the argument. Can be for example "-t" or "--timeout". |
Definition at line 309 of file command.hpp.
◆ isDefined()
bool Args::Command::isDefined |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ isMisspelledCommand()
bool Args::Command::isMisspelledCommand |
( |
const String & |
nm, |
|
|
StringList & |
possibleNames |
|
) |
| const |
|
inline |
- Returns
- Is given name a misspelled name of the command.
- Parameters
-
nm | Name to check (misspelled). |
possibleNames | List of possible names for the given misspelled name. |
Definition at line 233 of file command.hpp.
◆ isMisspelledName()
bool Args::Command::isMisspelledName |
( |
const String & |
nm, |
|
|
StringList & |
possibleNames |
|
) |
| const |
|
inlineoverridevirtual |
- Returns
- Is given name a misspelled name of the argument.
- Parameters
-
nm | Name to check (misspelled). |
possibleNames | List of possible names for the given misspelled name. |
Implements Args::ArgIface.
Definition at line 211 of file command.hpp.
◆ isWithValue()
bool Args::Command::isWithValue |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ longDescription()
const String & Args::Command::longDescription |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ process()
void Args::Command::process |
( |
Context & |
ctx | ) |
|
|
inlineoverrideprotectedvirtual |
Process argument's staff, for example take values from context.
This method invokes exactly at that moment when parser has found this argument.
- Parameters
-
Implements Args::ArgIface.
Definition at line 329 of file command.hpp.
◆ setCurrentSubCommand()
void Args::Command::setCurrentSubCommand |
( |
Command * |
sub | ) |
|
|
inlineprotected |
◆ setDefaultValue()
void Args::Command::setDefaultValue |
( |
const String & |
v | ) |
|
|
inline |
Set default value.
- Note
- Value will be pushed back to the list of default values.
Definition at line 193 of file command.hpp.
◆ setDefaultValues()
void Args::Command::setDefaultValues |
( |
const StringList & |
v | ) |
|
|
inline |
◆ setDescription()
void Args::Command::setDescription |
( |
const String & |
desc | ) |
|
|
inline |
◆ setLongDescription()
void Args::Command::setLongDescription |
( |
const String & |
desc | ) |
|
|
inline |
◆ setRequired()
void Args::Command::setRequired |
( |
bool |
on = true | ) |
|
|
inlineoverridevirtual |
◆ setValueSpecifier()
void Args::Command::setValueSpecifier |
( |
const String & |
vs | ) |
|
|
inline |
◆ type()
ArgType Args::Command::type |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ value()
const String & Args::Command::value |
( |
| ) |
const |
|
inline |
- Returns
- First value of this argument.
Definition at line 163 of file command.hpp.
◆ values()
const StringList & Args::Command::values |
( |
| ) |
const |
|
inline |
- Returns
- All values for this argument.
Definition at line 174 of file command.hpp.
◆ valueSpecifier()
const String & Args::Command::valueSpecifier |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ CmdLine
◆ Help
◆ HelpPrinter
The documentation for this class was generated from the following file: