fix bunyan CLI guard against -p and file args usage at the same time (was broken a while back)

master
Trent Mick 2017-04-04 23:21:29 -07:00
parent 994f90eb83
commit 58846afa89
2 changed files with 4 additions and 3 deletions

View File

@ -7,7 +7,8 @@ Known issues:
## not yet released
(nothing yet)
- Ensure that `bunyan` errors out if attempting to use `-p PID` and
file args at the same time.
## 1.8.9

View File

@ -1525,9 +1525,9 @@ function main(argv) {
console.log('bunyan ' + getVersion());
return;
}
if (opts.pid && opts.args.length > 0) {
if (opts.pids && opts.args.length > 0) {
warn('bunyan: error: can\'t use both "-p PID" (%s) and file (%s) args',
opts.pid, opts.args.join(' '));
opts.pids, opts.args.join(' '));
return drainStdoutAndExit(1);
}
if (opts.color === null) {