Skip to content

Instantly share code, notes, and snippets.

@ZeroX-DG
Created June 18, 2018 08:34
Show Gist options
  • Save ZeroX-DG/8eb2f674cc11af34686c54feb89ec747 to your computer and use it in GitHub Desktop.
Save ZeroX-DG/8eb2f674cc11af34686c54feb89ec747 to your computer and use it in GitHub Desktop.
import {Command} from '@oclif/command'
import chalk from 'chalk'
export default class Add extends Command {
static description = 'Add new todo to list'
static args = [{name: 'todo'}]
async run() {
const {args} = this.parse(Add)
const todo = args.todo
if (todo) {
this.log(`${chalk.green('[Success]')} Added new todo: ${todo}`)
} else {
this.error(chalk.red('please specify the new todo'))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment