UNPKG

commanding

Version:

A simple yet practical command-Line application framework, written in TypeScript.

22 lines (21 loc) 1.16 kB
import { Command as CommandInterface, ArgDetails, OptionDetails, CommandHandler, ParsedOptions, Presenter, Logger, ArgRequirement, OptionRequirement } from './interfaces'; export declare class Command implements CommandInterface { protected commandName: string; protected argRequirements: ArgRequirement[]; protected optionRequirements: OptionRequirement[]; protected handler?: CommandHandler; protected commandDescription?: string; protected currentArgPosition: number; constructor(commandName: string); getDescrption(): string | undefined; description(description: string): this; getArgRequirements(): ArgRequirement[]; getOptionRequirements(): OptionRequirement[]; argument(name: string, inputDetails?: ArgDetails): CommandInterface; option(fullName: string, inputDetails?: OptionDetails): CommandInterface; handle(handler: CommandHandler): CommandInterface; match(name: string): boolean; getName(): string; execute(parsedArgs: string[], parsedOptions: ParsedOptions, presenter: Presenter, logger: Logger): Promise<void>; showHelp(executable: string, presenter: Presenter): void; }