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

x/line/src/main_command.ts>MainCommand

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

This class represents the main command of the CLI.

Properties

subcommands: Subcommand[]

An array of subcommands that this main command can run. These should not be instantiated.

type: "command" | "subcommand"

Methods

handle(): void

This method is to be implemented by the user of this framework. This method is executed during runtime and should contain the code that this main command should process. For example, if this main command should log things to the console, then this method could have console.log( ... ) in its body.

run(input: string): Promise<void>

Run this main command.

setUp(): void

Set up this main command.

showHelp(): void

Show this main command's help menu.