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

x/line/src/subcommand.ts>Subcommand

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

This class represents a subcommand in the CLI. It can only be executed by the main command.

Constructors

new
Subcommand(mainCommand: MainCommand)

Construct an object of this class.

Properties

description: string
main_command: MainCommand

See MainCommand.

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 subcommand should process. For example, if the subcommand should write a file, then this method could have Deno.writeFileSync( ... ) in its body.

run(): Promise<void>

Run this subcommand.

showHelp(): void

Show this subcommand's help menu.