resolvePath function implemented and tested, all green.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import type { Result, ShellError } from "./result";
|
||||
import type { ShellState } from "./shell_state";
|
||||
|
||||
type CommandFn = (state: ShellState, flags: string[], args: string[]) => CommandOutput<ShellError>;
|
||||
|
||||
export interface CommandDescriptor {
|
||||
fn: CommandFn;
|
||||
name: string;
|
||||
flags?: readonly FlagDescriptor[];
|
||||
requresRoot?: boolean;
|
||||
description?: string;
|
||||
keybinds?: readonly string[];
|
||||
}
|
||||
|
||||
export interface FlagDescriptor {
|
||||
name: string;
|
||||
takesValue?: boolean;
|
||||
}
|
||||
|
||||
export interface CommandOutput<E extends ShellError> {
|
||||
readonly state: ShellState;
|
||||
readonly result: Result<E>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user