#include <utils/CommandLineParser.hpp>
◆ CommandLineCommand() [1/2]
openfluid::utils::CommandLineCommand::CommandLineCommand |
( |
| ) |
|
|
inline |
◆ CommandLineCommand() [2/2]
openfluid::utils::CommandLineCommand::CommandLineCommand |
( |
const std::string & |
Name, |
|
|
const std::string & |
HelpText, |
|
|
const std::string & |
LongHelpText = "" |
|
) |
| |
|
inline |
Instanciates a command with the given parameters
- Parameters
-
[in] | Name | The long name of the command |
[in] | HelpText | The help text associated to the command |
[in] | LongHelpText | The long help text associated to the command |
◆ activateOption()
bool openfluid::utils::CommandLineCommand::activateOption |
( |
const std::string & |
LongName, |
|
|
const std::string & |
Value = "" |
|
) |
| |
|
inline |
Activates the given option with the given value
- Parameters
-
[in] | LongName | The long name of the option |
[in] | Value | The value for activation (default is empty) |
◆ addArg()
void openfluid::utils::CommandLineCommand::addArg |
( |
const CommandLineArg & |
Arg | ) |
|
|
inline |
Adds an argument to the command
- Parameters
-
[in] | Arg | The argument to add |
[in] | Required | True if the arg is required |
◆ addArgs()
void openfluid::utils::CommandLineCommand::addArgs |
( |
const std::vector< CommandLineArg > & |
Args | ) |
|
|
inline |
Adds many args to the command
- Parameters
-
[in] | Arg | The argument list to add |
◆ addOption()
void openfluid::utils::CommandLineCommand::addOption |
( |
const CommandLineOption & |
Option | ) |
|
|
inline |
Adds an option to the command
- Parameters
-
[in] | Option | The option to add |
◆ addOptions()
void openfluid::utils::CommandLineCommand::addOptions |
( |
const std::vector< CommandLineOption > & |
Options | ) |
|
|
inline |
Adds many options to the command
- Parameters
-
[in] | Options | The option list to add |
◆ args()
const std::vector<CommandLineArg>& openfluid::utils::CommandLineCommand::args |
( |
| ) |
|
|
inline |
Returns the args registered for the command
- Returns
- The args
◆ getHelpText()
std::string openfluid::utils::CommandLineCommand::getHelpText |
( |
| ) |
const |
|
inline |
Returns the help text of the command
- Returns
- The help text
◆ getLongHelpText()
std::string openfluid::utils::CommandLineCommand::getLongHelpText |
( |
| ) |
const |
|
inline |
Returns the help text of the command
- Returns
- The help text
◆ getName()
std::string openfluid::utils::CommandLineCommand::getName |
( |
| ) |
const |
|
inline |
Returns the name of the command
- Returns
- The name (e.g. "search")
◆ getOptionNameFromShortName()
std::string openfluid::utils::CommandLineCommand::getOptionNameFromShortName |
( |
const std::string & |
ShortName | ) |
const |
|
inline |
Returns the long name of an option from its short name
- Parameters
-
[in] | ShortName | The requested short name for the option |
- Returns
- The long name
◆ getOptionValue()
std::string openfluid::utils::CommandLineCommand::getOptionValue |
( |
const std::string & |
LongName | ) |
const |
|
inline |
Returns the value given for an option
- Parameters
-
[in] | LongName | The long name for the option |
- Returns
- the value for the option
◆ isOptionActive()
bool openfluid::utils::CommandLineCommand::isOptionActive |
( |
const std::string & |
LongName | ) |
const |
|
inline |
Tests if an option is active
- Parameters
-
[in] | LongName | The long name for the searched option |
- Returns
- true if the option is active
◆ isOptionExists()
bool openfluid::utils::CommandLineCommand::isOptionExists |
( |
const std::string & |
LongName | ) |
const |
|
inline |
Tests if an option exists for the command
- Parameters
-
[in] | LongName | The long name for the searched option |
- Returns
- true if the option exists
◆ isOptionRequiresValue()
bool openfluid::utils::CommandLineCommand::isOptionRequiresValue |
( |
const std::string & |
LongName | ) |
const |
|
inline |
Tests if an option requires a value
- Parameters
-
[in] | LongName | The long name for the searched option |
- Returns
- true if the option requires a value
◆ options()
const std::map<std::string,CommandLineOption>& openfluid::utils::CommandLineCommand::options |
( |
| ) |
|
|
inline |
Returns the options registered for the command
- Returns
- The options
◆ optionsOrdered()
const std::vector<CommandLineOption>& openfluid::utils::CommandLineCommand::optionsOrdered |
( |
| ) |
|
|
inline |
Returns the options (ordered by addition) registered for the command
- Returns
- The options
◆ reset()
void openfluid::utils::CommandLineCommand::reset |
( |
| ) |
|
|
inline |
Resets all options to default (inactive with empty value)
The documentation for this class was generated from the following file: