24 lines
613 B
TypeScript
24 lines
613 B
TypeScript
export abstract class Command {
|
|
public abstract readonly _flags: CommandFlag[];
|
|
public abstract readonly _root: boolean;
|
|
//public abstract readonly _keybinds?: Map<KeyBind, () => any>;
|
|
public abstract readonly _help: string; //TODO: Dont know where to pull the help text from yet
|
|
public abstract result: CommandResult;
|
|
|
|
public abstract Main(this: Shell, flags: CommandFlag[], args: string[]): void;
|
|
}
|
|
|
|
export type CommandFlag = {
|
|
flag: string;
|
|
values?: string[];
|
|
};
|
|
|
|
export type CommandResult = {
|
|
bin: string;
|
|
flags?: CommandFlag[];
|
|
args?: string[];
|
|
path: number;
|
|
exitcode: ExitCode;
|
|
data?: any;
|
|
};
|