all files / lib/ Command.js

100% Statements 6/6
100% Branches 0/0
100% Functions 1/1
100% Lines 6/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26                                    22× 22× 22×    
#!/usr/bin/node
var helpers = require('./Helpers'),
    util = require('util');
 
/**
 * Command
 *
 * A command is a string, usually one of multiple, used for routing. Much like an API endpoint.
 * Commands are grouped, so you can validate against multiple sets.
 *
 * Options:
 *
 *  * name The name of the command
 *  * [description] Description of the command, used in help text and error messages.
 *  * [callback] function(cliInstance, command), A function that is called when this command is used.
 *
 * @param {{name, [description], [callback]}} options
 * @constructor
 */
function Command(options) {
    this.name = options.name;
    this.description = options.description;
    this.callback = options.callback;
}
 
module.exports = Command;