@oclif/example-multi-js
Version:
example multi-command CLI built with javascript
22 lines (17 loc) • 468 B
JavaScript
const {Command, flags} = require('@oclif/command')
class HelloCommand extends Command {
async run() {
const {flags} = this.parse(HelloCommand)
const name = flags.name || 'world'
this.log(`hello ${name} from ./src/commands/hello.js`)
}
}
HelloCommand.description = `
Describe the command here
...
Extra documentation goes here
`
HelloCommand.flags = {
name: flags.string({char: 'n', description: 'name to print'}),
}
module.exports = HelloCommand