1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const command_1 = require("@oclif/command");
|
4 | class Hello extends command_1.Command {
|
5 | async run() {
|
6 | const { args, flags } = this.parse(Hello);
|
7 | const name = flags.name || 'world';
|
8 | this.log(`hello ${name} from ./src/commands/hello.ts`);
|
9 | if (args.file && flags.force) {
|
10 | this.log(`you input --force and --file: ${args.file}`);
|
11 | }
|
12 | }
|
13 | }
|
14 | Hello.description = 'describe the command here';
|
15 | Hello.examples = [
|
16 | `$ example-multi-ts hello
|
17 | hello world from ./src/hello.ts!
|
18 | `,
|
19 | ];
|
20 | Hello.flags = {
|
21 | help: command_1.flags.help({ char: 'h' }),
|
22 |
|
23 | name: command_1.flags.string({ char: 'n', description: 'name to print' }),
|
24 |
|
25 | force: command_1.flags.boolean({ char: 'f' }),
|
26 | };
|
27 | Hello.args = [{ name: 'file' }];
|
28 | exports.default = Hello;
|