# 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:
  - vertx-shell-js/command_registry.js, line 35

### Methods

#### commands() → {Array.<Command>}

Source:
  - vertx-shell-js/command_registry.js, line 47

##### 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:
  - vertx-shell-js/command_registry.js, line 61

##### 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:
  - vertx-shell-js/command_registry.js, line 76

##### 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:
  - vertx-shell-js/command_registry.js, line 101

##### 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:
  - vertx-shell-js/command_registry.js, line 126

##### Returns:

a reference to this, so the API can be used fluently

Type
  CommandRegistry