starting impleemntation with the commands and such
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
export default class Arg {
|
||||
name?: string;
|
||||
description?: string;
|
||||
|
||||
isOptional?: boolean;
|
||||
isVariadic?: boolean;
|
||||
}
|
||||
@@ -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[]
|
||||
) {}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user