UNPKG

orgdo

Version:

Command-line tool to manage the Todo lists

22 lines (21 loc) 705 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const Cli_1 = require("../../Cli"); const Client_1 = require("../../Client"); exports.command = ["rm <id>", "remove", "del", "delete"]; exports.describe = "Remove task"; function builder(cmd) { return cmd.positional("id", { describe: "Id of task", type: "number" }); } exports.builder = builder; function handler(options) { Client_1.default.init().then(client => { new Cli_1.default(client) .remove(options) .then(() => { Client_1.print(`Remove task ${options.id}.`); }) .catch(err => Client_1.printErrorAndExit(err)); }); } exports.handler = handler;