1 | const {Command, flags, parse} = require('@anycli/command')
|
2 | const {cli} = require('cli-ux')
|
3 |
|
4 | class AnycliExampleSingleJsCommand extends Command {
|
5 | async run() {
|
6 | const options = parse(this.argv, AnycliExampleSingleJsCommand)
|
7 | const name = options.flags.name || 'world'
|
8 | cli.log(`hello ${name} from @anycli/example-single-js!`)
|
9 | }
|
10 | }
|
11 |
|
12 | AnycliExampleSingleJsCommand.flags = {
|
13 |
|
14 | version: flags.version(),
|
15 |
|
16 | help: flags.help(),
|
17 | name: flags.string({char: 'n', description: 'name to print'}),
|
18 | }
|
19 |
|
20 | module.exports = AnycliExampleSingleJsCommand
|