2014-05-10 10:19:47 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var EventEmitter = require('events').EventEmitter,
|
|
|
|
inherits = require('util').inherits;
|
|
|
|
|
|
|
|
function Command(params) {
|
|
|
|
params = params || {};
|
2015-05-03 21:53:11 +00:00
|
|
|
this.emitIn = params.emitIn;
|
2014-12-14 20:04:00 +00:00
|
|
|
this.emitOut = params.emitOut;
|
2015-06-28 14:47:34 +00:00
|
|
|
this.emitErr = params.emitErr;
|
|
|
|
this.attachStderr = params.attachStderr;
|
2014-05-10 10:19:47 +00:00
|
|
|
}
|
|
|
|
|
2014-12-03 21:24:00 +00:00
|
|
|
exports.Command = Command;
|
2014-05-10 10:19:47 +00:00
|
|
|
|
|
|
|
inherits(Command, EventEmitter);
|
|
|
|
|
|
|
|
Command.prototype.enableEmitter = function() {
|
2014-12-14 20:04:00 +00:00
|
|
|
this.emitOut = true;
|
2014-05-10 10:19:47 +00:00
|
|
|
return this;
|
|
|
|
};
|
|
|
|
|
|
|
|
Command.prototype.disableEmitter = function() {
|
2014-12-14 20:04:00 +00:00
|
|
|
this.emitOut = false;
|
2014-05-10 10:19:47 +00:00
|
|
|
return this;
|
|
|
|
};
|