UNPKG

691 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 = `
12Describe the command here
13...
14Extra documentation goes here
15`
16
17OclifExampleSingleJsCommand.flags = {
18 // add --version flag to show CLI version
19 version: flags.version({char: 'v'}),
20 // add --help flag to show CLI version
21 help: flags.help({char: 'h'}),
22 name: flags.string({char: 'n', description: 'name to print'}),
23}
24
25module.exports = OclifExampleSingleJsCommand