Guest User

Untitled

a guest
Jun 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import {Command} from '@oclif/command'
  2. import chalk from 'chalk'
  3.  
  4. export default class Add extends Command {
  5. static description = 'Add new todo to list'
  6.  
  7. static args = [{name: 'todo'}]
  8.  
  9. async run() {
  10. const {args} = this.parse(Add)
  11. const todo = args.todo
  12. if (todo) {
  13. this.log(`${chalk.green('[Success]')} Added new todo: ${todo}`)
  14. } else {
  15. this.error(chalk.red('please specify the new todo'))
  16. }
  17. }
  18. }
Add Comment
Please, Sign In to add comment