declares semantics of a command
More...
#include <tools/nfdc/command-definition.hpp>
declares semantics of a command
Definition at line 127 of file command-definition.hpp.
nfd::tools::nfdc::CommandDefinition::CommandDefinition |
( |
const std::string & |
noun, |
|
|
const std::string & |
verb |
|
) |
| |
nfd::tools::nfdc::CommandDefinition::~CommandDefinition |
( |
| ) |
|
|
default |
declare an argument
- Parameters
-
name | argument name, must be unique |
valueType | argument value type |
isRequired | whether the argument is required |
allowPositional | whether the argument value can be specified as positional |
metavar | displayed argument value placeholder |
Definition at line 105 of file command-definition.cpp.
const std::string nfd::tools::nfdc::CommandDefinition::getNoun |
( |
| ) |
const |
|
inline |
const std::string& nfd::tools::nfdc::CommandDefinition::getTitle |
( |
| ) |
const |
|
inline |
const std::string nfd::tools::nfdc::CommandDefinition::getVerb |
( |
| ) |
const |
|
inline |
CommandArguments nfd::tools::nfdc::CommandDefinition::parse |
( |
const std::vector< std::string > & |
tokens, |
|
|
size_t |
start = 0 |
|
) |
| const |
parse a command line
- Parameters
-
tokens | command line tokens |
start | command line start position, after noun and verb |
- Exceptions
-
Error | command line is invalid |
Definition at line 130 of file command-definition.cpp.
CommandDefinition& nfd::tools::nfdc::CommandDefinition::setTitle |
( |
const std::string & |
title | ) |
|
|
inline |
set one-line description
- Parameters
-
title | one-line description, written in lower case |
Definition at line 169 of file command-definition.hpp.