hueadm
Version:
A command line management interface to phillips hue
40 lines (30 loc) • 794 B
JavaScript
var common = require('../common');
module.exports = deleteSchedule;
function deleteSchedule(subcmd, opts, args, cb) {
var self = this;
var finish = common.makeFinisher(opts, cb);
if (opts.help) {
self.do_help('help', {}, [subcmd], cb);
return;
}
var id = parseInt(args.shift(), 10);
if (isNaN(id)) {
cb(new Error('`id` argument must be a number'));
return;
}
self.debug('deleteSchedule(%d)', id);
self.client.deleteSchedule(id, finish);
}
deleteSchedule.options = [
{
names: ['help', 'h'],
type: 'bool',
help: 'Show this help.'
},
{
names: ['json', 'j'],
type: 'bool',
help: 'JSON output.'
}
];
deleteSchedule.help = 'Delete a schedule\n\n{{options}}';