UNPKG

940 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const command_1 = require("@oclif/command");
4class 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}
14Hello.description = 'describe the command here';
15Hello.examples = [
16 `$ example-multi-ts hello
17hello world from ./src/hello.ts!
18`,
19];
20Hello.flags = {
21 help: command_1.flags.help({ char: 'h' }),
22 // flag with a value (-n, --name=VALUE)
23 name: command_1.flags.string({ char: 'n', description: 'name to print' }),
24 // flag with no value (-f, --force)
25 force: command_1.flags.boolean({ char: 'f' }),
26};
27Hello.args = [{ name: 'file' }];
28exports.default = Hello;