Skip to main content
Module

x/denomander/docs.ts>Command

Deno command-line interfaces made easy
Latest
class Command
Re-export
import { Command } from "https://deno.land/x/denomander@0.9.3/docs.ts";

Constructors

new
Command(params: CommandParams)

Constructor of Command object

Properties

private
_errors: Array<CommandError>

Array of all command errors

private
_isDefault: boolean
private
optional
_parentCommand: Command
private
_subCommands: Array<Command>
private
optional
_word_command: string

Holds the short flag (-p). One letter command

private
params: CommandParams

Holds the object's options initiated in constructor

action: Function

Getter of the command action (callback function)

aliases: Array<string>

Holds all the aliases of the current command

command_arguments: Array<CommandArgument>

Holds all the command arguments of the current command

declaration: string
description: string

Getter of the command description

readonly
errors: Array<CommandError>
readonly
isDefault
options: Array<Option>

Holds all the options of the current command

readonly
parentCommand: Command | undefined
require_command_value: boolean

If the command has a required value to be passed from the user

requiredOptions: Array<Option>

Holds all the required options of the current command

readonly
subCommands: Array<Command>
readonly
usage: string

Gets the usage of the command (used in help screen)

value: string

Getter of the command value

word_command: string | undefined

Getter of the long flag (word command)

Methods

It splits the word command and detects if there is a require command value.

addAlias(alias: string): Command
addCustomOption(customOption: CustomOption)

Instantiates a new Option object and pushes it to options[] array

hasAlias(): boolean

Detects if the command has aliases

hasOptions(): boolean

Detects if the current instance has required options

setArgDescription(arg: string, description: string)