Members
(static) dependencies :Array.<string>
Class dependencies:
['app', 'command', 'command.runner', 'file', 'terminal', 'yargs']
.
handlers :Array.<Promise.<*>>
Currently running command handlers.
commandRepository :console.repositories.CommandRepository
The command repository.
Methods
add(command)
Add a command in the repository.
Parameters:
Name | Type | Description |
---|---|---|
command |
function | A command to add. |
addFromFolder(folder)
Add all commands in the given folder.
Parameters:
Name | Type | Description |
---|---|---|
folder |
string | A folder from which load commands. |
setDefault(Command)
Set default command to be executed of nothing is provided.
Parameters:
Name | Type | Description |
---|---|---|
Command |
console.Command | function | The default command. |
getDefault()
Retrieve default command from the command repository.
Returns:
The default command instance.
- Type
- console.Command | null
(async) resolve(command, internalopt)
Resolve given console command by getting the related Command
instance and make it handle the request.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
command |
string | Array.<string> | The command to resolve. | ||
internal |
boolean |
<optional> |
false
|
Specify if the command should be processed as an internal process. If if should check the policies restrictions, set to false. |
Returns:
The async process promise.
- Type
- Promise
bootstrap(yargs, withPoliciesopt)
Bootstrap the commands in Yargs.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
yargs |
yargs | The Yargs instance. | ||
withPolicies |
boolean |
<optional> |
true
|
Indicates that the policies should be checked before bootstrapping them. |