@grandlinex/easy-cli
Version:
Cli lib to perform common tasks
27 lines (26 loc) • 872 B
TypeScript
import { CoreLogChannel, CoreLogger } from '@grandlinex/core';
import { CmdProperty, IArgs, IHandler, ParamTypeRaw } from '../lib/types.js';
export type ShellCommandParentProps = {
logger: CoreLogger;
handler: IHandler;
};
export type ShellCommandProps = {
name: string;
description: string;
properties: CmdProperty[];
subCommands?: ShellCommand[];
level?: number;
} & ShellCommandParentProps;
export declare abstract class ShellCommand extends CoreLogChannel {
name: string;
level: number;
description: string;
handler: IHandler;
properties: CmdProperty[];
subCommands: ShellCommand[];
protected constructor(conf: ShellCommandProps);
private validateFields;
start(parser: IArgs): Promise<boolean>;
abstract run(parser: IArgs): Promise<boolean>;
protected resolvePath(path?: ParamTypeRaw): string;
}