WIP: new abstraction layer, file system now a singleton, shell should be too
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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;
|
||||
};
|
||||
Reference in New Issue
Block a user