1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | var Factory = require('../util/factory'),
|
7 | factory = new Factory('command', __dirname, true);
|
8 |
|
9 | function Command() {}
|
10 |
|
11 | factory.bindClassMethods(Command);
|
12 |
|
13 | Command.prototype = {
|
14 | toolName: function () {
|
15 | return require('../util/meta').NAME;
|
16 | },
|
17 |
|
18 | type: function () {
|
19 | return this.constructor.TYPE;
|
20 | },
|
21 | synopsis: function () {
|
22 | return "the developer has not written a one-line summary of the " + this.type() + " command";
|
23 | },
|
24 | usage: function () {
|
25 | console.error("the developer has not provided a usage for the " + this.type() + " command");
|
26 | },
|
27 | run: function (args, callback) {
|
28 | return callback(new Error("run: must be overridden for the " + this.type() + " command"));
|
29 | }
|
30 | };
|
31 |
|
32 | module.exports = Command;
|
33 |
|