UNPKG

@sex-pomelo/sex-pomelo-cli

Version:

Pomelo command line client for managing pomelo

28 lines (22 loc) 577 B
let consts = require('../consts'); module.exports = function(opts) { return new Command(opts); }; module.exports.commandId = 'kill'; module.exports.helpCommand = 'help kill'; let Command = function(opt){ } Command.prototype.handle = function(agent, comd, argv, rl, client, msg){ rl.question(consts.KILL_QUESTION_INFO, function(answer){ if(answer === 'yes'){ client.request(consts.CONSOLE_MODULE, { signal: "kill" }, function(err, data) { if (err) console.log(err); rl.prompt(); }); } else { rl.prompt(); } }); }