starting impleemntation with the commands and such

This commit is contained in:
Arjun Patel
2022-02-13 20:32:42 -08:00
parent d2a807248d
commit 61ae7b2b4b
5 changed files with 65 additions and 3 deletions
+7
View File
@@ -0,0 +1,7 @@
export default class Arg {
name?: string;
description?: string;
isOptional?: boolean;
isVariadic?: boolean;
}
+17
View File
@@ -0,0 +1,17 @@
import Arg from "./arg";
import Option from "./option";
export enum CommandType {
git = "git",
npm = "npm",
commit = "git commit",
}
export default class Command {
constructor(
type: CommandType,
subcommands?: Command[],
args?: Arg | Arg[],
options?: Option[]
) {}
}
+13
View File
@@ -0,0 +1,13 @@
import Arg from "./arg";
export default class Option {
name: string | string[];
description?: string;
args: Arg | Arg[];
constructor(_name: string | string[], _desc: string, _args: Arg | Arg[]) {
this.args = _args;
this.name = _name;
this.description = _desc;
}
}