@anycli/example-plugin-ts
Version:
example dxcli plugin in typescript
45 lines (44 loc) • 1.39 kB
TypeScript
import { Command, flags } from '@anycli/command';
export default class Hello extends Command {
static title: string;
static description: string;
static examples: string[];
static flags: {
name: flags.IOptionFlag<string | undefined>;
force: {
name: string;
char?: "a" | "b" | "i" | "p" | "q" | "s" | "u" | "g" | "c" | "d" | "e" | "f" | "h" | "j" | "k" | "l" | "m" | "n" | "o" | "r" | "t" | "v" | "x" | "y" | "z" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "X" | "Y" | "Z" | undefined;
description?: string | undefined;
hidden?: boolean | undefined;
required?: boolean | undefined;
parse(input: boolean): boolean;
} & {
type: "boolean";
allowNo: boolean;
};
};
static args: {
name: string;
required: boolean;
description: string;
}[];
options: {
flags: {
name: any;
force: any;
};
args: {
[name: string]: string;
};
argv: string[];
raw: ({
type: "arg";
input: string;
} | {
type: "flag";
flag: string;
input: string;
})[];
};
run(): Promise<void>;
}