arturadib/shelljs — pull request #151 by tminglei (2014-08-17 12:22:31+00:00)
Title: support costom echo in exec command

`shelljs` makes me happy when writing automatical scripts. Thanks so much! :+1:

But when executing parallel jobs, to distinguish different child process' console out, I had to make my custom execAsync:
```javascript
function execAsync(cmd, opts, callback) {
opts = opts || {};

var c = child.exec(cmd, { env: process.env }, function (err) {
if (callback) callback(err ? err.code : 0);
});

var echo = opts.echo || process.stdout.write;
c.stdout.on('data', function (data) {
echo(data);
});

c.stderr.on('data', function (data) {
echo(data);
});

return c;
}
exports.execAsync = execAsync;
```

Which enable me pass in my custom echo.

And my custom echo will auto add a specified prefix to every echo message. Its factory function is like this:
```javascript
function prefixEcho(prefix) {
return function (message) {
echo('[' + prefix + '] ' + message.replace(/\n$/, ''));
}
}
exports.prefixEcho = prefixEcho;
```

Realizing this feature will also be useful for other people, I made the pull request.

**Can you help review and give your suggestions?**