Command in the command line interface.
More...
#include <command.hpp>
Command in the command line interface.
Definition at line 27 of file command.hpp.
◆ Command()
◆ ~Command()
| virtual Args::Command::~Command |
( |
| ) |
|
|
inlinevirtual |
◆ addArg() [1/3]
Add argument.
- Note
- Developer should handle lifetime of the argument.
Definition at line 60 of file group_iface.hpp.
◆ addArg() [2/3]
Add argument.
- Note
- Developer should handle lifetime of the argument.
Definition at line 66 of file group_iface.hpp.
◆ addArg() [3/3]
◆ 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 345 of file command.hpp.
◆ clear()
| void Args::Command::clear |
( |
| ) |
|
|
inlineoverridevirtual |
◆ defaultValue()
| const String & Args::Command::defaultValue |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ 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 268 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 292 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 214 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 192 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 313 of file command.hpp.
◆ setCurrentSubCommand()
| void Args::Command::setCurrentSubCommand |
( |
Command * | sub | ) |
|
|
inlineprotected |
◆ setDefaultValue()
Set default value.
- Note
- Value will be pushed back to the list of default values.
Definition at line 172 of file command.hpp.
◆ setDefaultValues()
◆ setDescription()
◆ setLongDescription()
| Command & Args::Command::setLongDescription |
( |
const String & | desc | ) |
|
|
inline |
◆ setRequired()
| Command & Args::Command::setRequired |
( |
bool | on = true | ) |
|
|
inlineoverridevirtual |
◆ setValueSpecifier()
◆ type()
| ArgType Args::Command::type |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ value()
| const String & Args::Command::value |
( |
| ) |
const |
|
inline |
- Returns
- First value of this argument.
Definition at line 139 of file command.hpp.
◆ values()
| const StringList & Args::Command::values |
( |
| ) |
const |
|
inline |
- Returns
- All values for this argument.
Definition at line 151 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: