hueadm
Version:
A command line management interface to phillips hue
38 lines (29 loc) • 700 B
JavaScript
var common = require('../common');
module.exports = schedule;
function schedule(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 = args.shift();
if (!id) {
cb(new Error('first argument must be supplied'));
return;
}
self.client.schedule(id, finish);
}
schedule.options = [
{
names: ['help', 'h'],
type: 'bool',
help: 'Show this help.'
},
{
names: ['json', 'j'],
type: 'bool',
help: 'JSON output.'
}
];
schedule.help = 'Show a schedule\n\n{{options}}';