1 | import * as Config from '@oclif/config';
|
2 | import * as Parser from '@oclif/parser';
|
3 | import * as flags from './flags';
|
4 | import { PrettyPrintableError } from '@oclif/errors';
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export default abstract class Command {
|
10 | argv: string[];
|
11 | config: Config.IConfig;
|
12 | static _base: string;
|
13 |
|
14 | static id: string;
|
15 | static title: string | undefined;
|
16 | |
17 |
|
18 |
|
19 |
|
20 | static description: string | undefined;
|
21 |
|
22 | static hidden: boolean;
|
23 |
|
24 | static usage: string | string[] | undefined;
|
25 | static help: string | undefined;
|
26 |
|
27 | static aliases: string[];
|
28 |
|
29 | static strict: boolean;
|
30 | static parse: boolean;
|
31 |
|
32 | static flags?: flags.Input<any>;
|
33 |
|
34 | static args?: Parser.args.Input;
|
35 | static plugin: Config.IPlugin | undefined;
|
36 |
|
37 | static examples: string[] | undefined;
|
38 | static parserOptions: {};
|
39 | |
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 | static run: Config.Command.Class['run'];
|
47 | id: string | undefined;
|
48 | protected debug: (...args: any[]) => void;
|
49 | constructor(argv: string[], config: Config.IConfig);
|
50 | get ctor(): typeof Command;
|
51 | _run<T>(): Promise<T | undefined>;
|
52 | exit(code?: number): never;
|
53 | warn(input: string | Error): void;
|
54 | error(input: string | Error, options: {
|
55 | code?: string;
|
56 | exit: false;
|
57 | } & PrettyPrintableError): void;
|
58 | error(input: string | Error, options?: {
|
59 | code?: string;
|
60 | exit?: number;
|
61 | } & PrettyPrintableError): never;
|
62 | log(message?: string, ...args: any[]): void;
|
63 | /**
|
64 | * actual command run code goes here
|
65 | */
|
66 | abstract run(): PromiseLike<any>;
|
67 | protected init(): Promise<any>;
|
68 | protected parse<F, A extends {
|
69 | [name: string]: any;
|
70 | }>(options?: Parser.Input<F>, argv?: string[]): Parser.Output<F, A>;
|
71 | protected catch(err: any): Promise<any>;
|
72 | protected finally(_: Error | undefined): Promise<any>;
|
73 | protected _help(): never;
|
74 | protected _helpOverride(): boolean;
|
75 | protected _version(): never;
|
76 | }
|