UNPKG

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