diff --git a/bin/newman.js b/bin/newman.js index 68128eb91..118d82f13 100755 --- a/bin/newman.js +++ b/bin/newman.js @@ -85,10 +85,9 @@ program }); }); -program.on('--help', function () { - console.info('\nTo get available options for a command:'); - console.info(' newman -h'); -}); +program.addHelpText('after', ` +To get available options for a command: + newman -h`); // Warn on invalid command and then exits. program.on('command:*', (command) => { diff --git a/package-lock.json b/package-lock.json index bcbe7e518..097df9b81 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1149,9 +1149,9 @@ } }, "commander": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==" + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.1.0.tgz", + "integrity": "sha512-pRxBna3MJe6HKnBGsDyMv8ETbptw3axEdYHoqNh7gu5oDcew8fs0xnivZGm06Ogk8zGAJ9VX+OPEr2GXEQK4dg==" }, "comment-parser": { "version": "1.1.2", diff --git a/package.json b/package.json index 00de486f2..b18a8e2d7 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "cli-progress": "3.9.0", "cli-table3": "0.6.0", "colors": "1.4.0", - "commander": "6.2.1", + "commander": "7.1.0", "csv-parse": "4.15.3", "eventemitter3": "4.0.7", "filesize": "6.1.0", diff --git a/test/cli/run-options.test.js b/test/cli/run-options.test.js index f1aab6d09..04e773f1a 100644 --- a/test/cli/run-options.test.js +++ b/test/cli/run-options.test.js @@ -26,8 +26,8 @@ describe('CLI run options', function () { it('should display help message if no arguments are provided', function (done) { exec('node ./bin/newman.js', function (code, stdout, stderr) { expect(code, 'should have exit code of 1').to.equal(1); - expect(stdout).to.match(/Usage: newman*/); - expect(stderr).to.equal(''); + expect(stderr).to.match(/Usage: newman*/); + expect(stdout).to.equal(''); done(); }); }); diff --git a/test/unit/cli.test.js b/test/unit/cli.test.js index 09383b991..b523e2b22 100644 --- a/test/unit/cli.test.js +++ b/test/unit/cli.test.js @@ -43,8 +43,6 @@ describe('cli parser', function () { // explicitly match object to track addition/deletion of properties. expect(opts).to.eql({ - args: ['collection.json'], - rawArgs: null, collection: 'collection.json', reporters: ['cli'], delayRequest: 0,