Each command option is a command line parameter. It can have a type (see dpp::command_option_type), a name, a description, can be required or optional, and can have zero or more choices (for multiple choice), plus options. Adding options acts like sub-commands and can contain more options.
More...
#include <slashcommand.h>
Each command option is a command line parameter. It can have a type (see dpp::command_option_type), a name, a description, can be required or optional, and can have zero or more choices (for multiple choice), plus options. Adding options acts like sub-commands and can contain more options.
◆ command_option() [1/2]
dpp::command_option::command_option |
( |
| ) |
|
|
default |
Construct a new command option object.
◆ command_option() [2/2]
dpp::command_option::command_option |
( |
command_option_type |
t, |
|
|
const std::string & |
name, |
|
|
const std::string & |
description, |
|
|
bool |
required = false |
|
) |
| |
Construct a new command option object.
- Parameters
-
t | Option type |
name | Option name |
description | Option description |
required | True if this is a mandatory parameter |
◆ add_choice()
Add a multiple choice option.
- Parameters
-
- Returns
- command_option& returns a reference to self for chaining of calls
◆ add_option()
Add a sub-command option.
- Parameters
-
o | Sub-command option to add |
- Returns
- command_option& return a reference to self for chaining of calls
◆ choices
List of choices for multiple choice command.
◆ description
std::string dpp::command_option::description |
Option description (1-100 chars)
◆ name
std::string dpp::command_option::name |
◆ options
◆ required
bool dpp::command_option::required |
True if this is a mandatory parameter.
◆ type
Option type (what type of value is accepted)