Hypercubed/todo-md

View on GitHub
cmds/rm.js

Summary

Maintainability
B
4 hrs
Test Coverage

// Local
var todo = require('../lib/todo.js');

module.exports = function (program) {
  'use strict';

  program
    .command('rm <index>')
    .description('Remove task(s)')
    .action(function (index) {
      todo
        .options(program)
        .load()
        .rm(index)
        .write();

      if (!program.quiet) {
        todo.list();

        if (program.stats) {
          todo.stats();
        }
      }
    });
};