UNPKG

690 BJavaScriptView Raw
1const {Command, flags} = require('@oclif/command')
2
3class OclifExampleSingleJsCommand extends Command {
4 async run() {
5 const {flags} = this.parse(OclifExampleSingleJsCommand)
6 const name = flags.name || 'world'
7 this.log(`hello ${name} from ./src/index.js`)
8 }
9}
10
11OclifExampleSingleJsCommand.description = `Describe the command here
12...
13Extra documentation goes here
14`
15
16OclifExampleSingleJsCommand.flags = {
17 // add --version flag to show CLI version
18 version: flags.version({char: 'v'}),
19 // add --help flag to show CLI version
20 help: flags.help({char: 'h'}),
21 name: flags.string({char: 'n', description: 'name to print'}),
22}
23
24module.exports = OclifExampleSingleJsCommand