UNPKG

@oclif/example-multi-js

Version:

example multi-command CLI built with javascript

21 lines (16 loc) 467 B
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