@ideascol/cli-maker
Version:
A simple library to help create CLIs
30 lines (29 loc) • 886 B
TypeScript
import { Command, CLIOptions } from '../interfaces';
export declare class CLI {
private name;
private description;
private options?;
private commands;
private validator;
constructor(name: string, description: string, options?: CLIOptions | undefined);
getCommands(): Command[];
getName(): string;
getDescription(): string;
getOptions(): CLIOptions | undefined;
command(command: Command): void;
setOptions(options: CLIOptions): void;
parse(argv: string[]): void;
help(): void;
private commandHelp;
private findCommand;
private findSubcommand;
private showUnknownCommandError;
private getMissingParams;
private getOptionalParams;
private handleMissingParams;
private parseArgs;
private validateParam;
private findParamType;
private promptForMissingParams;
private promptWithArrows;
}