Members
(static) dependencies :Array.<string>
Class dependencies:
['app', 'terminal', 'yargs']
.
Methods
all(withPoliciesopt, groupedopt)
Get all commands.
Can return either an array of commands or a dictionary associating groups of commands based on names.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
withPolicies |
boolean |
<optional> |
true
|
Use gate service to filter valid commands by policies. |
grouped |
boolean |
<optional> |
false
|
Request grouped command result instead of a single array. |
Returns:
The commands or the grouped commands.
- Type
- Array.<Command> | object.<string, Array.<Command>>
get(name)
Get command by name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The command name. |
Returns:
The command instance, or null if not found.
- Type
- console.Command | null
has(name)
Check if command is registered.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The command name. |
Returns:
Indicates if the command exists.
- Type
- boolean
add(command)
Add given command in the command list.
Parameters:
Name | Type | Description |
---|---|---|
command |
function | console.Command | The command class or instance. |
Returns:
The current command repository instance.
makeCommand(command)
Make a command instance.
Parameters:
Name | Type | Description |
---|---|---|
command |
Command | function | A command class. |
Returns:
The command class instance.
- Type
- Command