Class: CommandRegistry

vertx-shell-js/command_registry~ CommandRegistry

new CommandRegistry()

A registry that contains the commands known by a shell.

It is a mutable command resolver.

Source:

Methods

commands() → {Array.<Command>}

Source:
Returns:
the current commands
Type
Array.<Command>

getCommand(name) → {Command}

Returns a single command by its name.
Parameters:
Name Type Description
name string the command name
Source:
Returns:
the commad or null
Type
Command

registerCommand(command, completionHandler) → {CommandRegistry}

Register a command
Parameters:
Name Type Description
command Command the command to register
completionHandler function notified when the command is registered
Source:
Returns:
a reference to this, so the API can be used fluently
Type
CommandRegistry

registerCommands(commands, completionHandler) → {CommandRegistry}

Register a list of commands.
Parameters:
Name Type Description
commands Array.<Command> the commands to register
completionHandler function notified when the command is registered
Source:
Returns:
a reference to this, so the API can be used fluently
Type
CommandRegistry

unregisterCommand(commandName, completionHandler) → {CommandRegistry}

Unregister a command.
Parameters:
Name Type Description
commandName string the command name
completionHandler function notified when the command is unregistered
Source:
Returns:
a reference to this, so the API can be used fluently
Type
CommandRegistry