nomad.terminal
nomad.terminal.registerCommand(command)
Section titled “nomad.terminal.registerCommand(command)”Register a Webterm page command. See the Webterm documentation on page commands.
- command Object
- handle Function. The command’s handling function. May be async. Accepts a single
optsobject as the first argument and then any number of positional arguments after. - name String. The name of the command.
- help String. An optional help description of the command.
- usage String. An optional usage description of the command.
- handle Function. The command’s handling function. May be async. Accepts a single
- Returns Void
nomad.terminal.registerCommand({ name: 'alert', help: 'Display an alert box', usage: 'alert {message}', async handle (opts = {}, message = '') { alert(message) }})// @alert "Hello World"nomad.terminal.unregisterCommand(commandName)
Section titled “nomad.terminal.unregisterCommand(commandName)”Unregisters a Webterm page command.
- commandName String. The name of the command to unregister.
- Returns Void.
nomad.terminal.unregisterCommand('alert')