diff --git a/lib/bin.js b/lib/bin.js index 0069bb37..2ccedd37 100755 --- a/lib/bin.js +++ b/lib/bin.js @@ -78,12 +78,16 @@ const shouldJSON = (conf, result) => const pretty = (conf, result) => shouldJSON(conf, result) ? JSON.stringify(result, 0, 2) : result +let addedLogListener = false const main = args => { const conf = parse(args) if (conf.help || conf.h) return console.log(usage()) - process.on('log', console.error) + if (!addedLogListener) { + process.on('log', console.error) + addedLogListener = true + } try { return run(conf)