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 | static run: Config.Command.Class['run'];
|
46 | id: string | undefined;
|
47 | protected debug: (...args: any[]) => void;
|
48 | constructor(argv: string[], config: Config.IConfig);
|
49 | get ctor(): typeof Command;
|
50 | _run<T>(): Promise<T | undefined>;
|
51 | exit(code?: number): never;
|
52 | warn(input: string | Error): void;
|
53 | error(input: string | Error, options: {
|
54 | code?: string;
|
55 | exit: false;
|
56 | } & PrettyPrintableError): void;
|
57 | error(input: string | Error, options?: {
|
58 | code?: string;
|
59 | exit?: number;
|
60 | } & PrettyPrintableError): never;
|
61 | log(message?: string, ...args: any[]): void;
|
62 | /**
|
63 | * actual command run code goes here
|
64 | */
|
65 | abstract run(): PromiseLike<any>;
|
66 | protected init(): Promise<any>;
|
67 | protected parse<F, A extends {
|
68 | [name: string]: any;
|
69 | }>(options?: Parser.Input<F>, argv?: string[]): Parser.Output<F, A>;
|
70 | protected catch(err: any): Promise<any>;
|
71 | protected finally(_: Error | undefined): Promise<any>;
|
72 | protected _help(): never;
|
73 | protected _helpOverride(): boolean;
|
74 | protected _version(): never;
|
75 | }
|