Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/line/src/command.ts>Command

A class-based, command-line interface (CLI) framework.
Latest
class Command
Abstract
import { Command } from "https://deno.land/x/line@v1.0.1/src/command.ts";

A class representing a command in the CLI.

Properties

protected
arguments_map: Map<string, IArgument>

Used internally during runtime for performance and getting/checking of arguments.

protected
options_map: Map<string, IOption>

Used internally during runtime for performance and getting/checking of options.

protected
takes_arguments: boolean

Does this command take arguments?

protected
takes_options: boolean

Does this command take options?

arguments: TArgument

A key-value pair object of argument descriptions where the key is the argument and the value is the description.

name: string

This command's name.

options: TOption

A key-value pair object of options where the key is the option signature (or a comma-delimited list of signatures) and the value is the description.

signature: string

This command's signature.

abstract
type: "command" | "subcommand"

The types of commands that can extend this class.

Methods

protected
validateDenoArgs(denoArgs: string[]): string[]
argument(argumentName: string): string | undefined

Get the value of the specified argument.

Get the help menu "ARGUMENTS" section for this command.

Get the help menu "OPTIONS" section for this command.

abstract
handle(): void

Run this command's handler.

option(optionName: string): string | boolean | undefined

Get the value of the specified option.

setUp(): void

Set up this command.

abstract
showHelp(): void

Show this command's help menu.