Repository: yargs/yargs
Pull request #1126 (2018-05-10 00:25:00)

fix: .argv and .parse() now invoke identical code path
* library updates to address `npm audit` issues.
* fix inconsistency between `yargs.argv` and `yargs.parse()`, which was causing issues with tests.
* fix 1,000,000 linting issues for new standard.


Patch:
diff --git a/lib/levenshtein.js b/lib/levenshtein.js
index f32b0c2..dd31073 100644
--- a/lib/levenshtein.js
+++ b/lib/levenshtein.js
@@ -37,8 +37,8 @@ module.exports = function levenshtein (a, b) {
         matrix[i][j] = matrix[i - 1][j - 1]
       } else {
         matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution
-                                Math.min(matrix[i][j - 1] + 1, // insertion
-                                         matrix[i - 1][j] + 1)) // deletion
+          Math.min(matrix[i][j - 1] + 1, // insertion
+            matrix[i - 1][j] + 1)) // deletion
       }
     }
   }
diff --git a/lib/validation.js b/lib/validation.js
index f4655b4..d72ad52 100644
--- a/lib/validation.js
+++ b/lib/validation.js
@@ -37,7 +37,7 @@ module.exports = function validation (yargs, usage, y18n) {
           )
         } else {
           usage.fail(
-          __('Too many non-option arguments: got %s, maximum of %s', _s, demandedCommands._.max)
+            __('Too many non-option arguments: got %s, maximum of %s', _s, demandedCommands._.max)
           )
         }
       }
diff --git a/package.json b/package.json
index f25d324..1d38b45 100644
--- a/package.json
+++ b/package.json
@@ -28,15 +28,15 @@
   "devDependencies": {
     "chai": "^4.1.2",
     "chalk": "^1.1.3",
-    "coveralls": "^2.11.11",
+    "coveralls": "^3.0.1",
     "cpr": "^2.0.0",
     "cross-spawn": "^6.0.4",
     "es6-promise": "^4.0.2",
     "hashish": "0.0.4",
-    "mocha": "^3.0.1",
-    "nyc": "^11.2.1",
+    "mocha": "^5.1.1",
+    "nyc": "^11.7.3",
     "rimraf": "^2.5.0",
-    "standard": "^8.6.0",
+    "standard": "^11.0.1",
     "standard-version": "^4.2.0",
     "which": "^1.2.9",
     "yargs-test-extends": "^1.0.1"
diff --git a/yargs.js b/yargs.js
index 478360d..c4f9861 100644
--- a/yargs.js
+++ b/yargs.js
@@ -529,7 +529,9 @@ function Yargs (processArgs, cwd, parentRequire) {
   let parseContext = null
   self.parse = function parse (args, shortCircuit, _parseFn) {
     argsert('[string|array] [function|boolean|object] [function]', [args, shortCircuit, _parseFn], arguments.length)
-    if (typeof args === 'undefined') args = processArgs
+    if (typeof args === 'undefined') {
+      return self._parseArgs(processArgs)
+    }
 
     // a context object can optionally be provided, this allows
     // additional information to be passed to a command handler.


Test patch:
diff --git a/test/command.js b/test/command.js
index 9e2d532..0fe6bf3 100644
--- a/test/command.js
+++ b/test/command.js
@@ -36,13 +36,13 @@ describe('Command', () => {
           argv.awesome.should.equal('world')
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('populates outer argv with positional arguments', () => {
       const argv = yargs('foo hello world')
         .command('foo <bar> [awesome]')
-        .argv
+        .parse()
 
       argv._.should.include('foo')
       argv.bar.should.equal('hello')
@@ -52,7 +52,7 @@ describe('Command', () => {
     it('populates argv with camel-case variants of arguments when possible', () => {
       const argv = yargs('foo hello world')
         .command('foo <foo-bar> [baz-qux]')
-        .argv
+        .parse()
 
       argv._.should.include('foo')
       argv['foo-bar'].should.equal('hello')
@@ -64,7 +64,7 @@ describe('Command', () => {
     it('populates argv with camel-case variants of variadic args when possible', () => {
       const argv = yargs('foo hello world !')
         .command('foo <foo-bar> [baz-qux..]')
-        .argv
+        .parse()
 
       argv._.should.include('foo')
       argv['foo-bar'].should.equal('hello')
@@ -76,16 +76,16 @@ describe('Command', () => {
     it('populates subcommand\'s inner argv with positional arguments', () => {
       yargs('foo bar hello world')
         .command('foo', 'my awesome command', yargs => yargs.command(
-            'bar <greeting> [recipient]',
-            'subcommands are cool',
-            noop,
-            (argv) => {
-              argv._.should.deep.equal(['foo', 'bar'])
-              argv.greeting.should.equal('hello')
-              argv.recipient.should.equal('world')
-            }
-          ))
-        .argv
+          'bar <greeting> [recipient]',
+          'subcommands are cool',
+          noop,
+          (argv) => {
+            argv._.should.deep.equal(['foo', 'bar'])
+            argv.greeting.should.equal('hello')
+            argv.recipient.should.equal('world')
+          }
+        ))
+        .parse()
     })
 
     it('ignores positional args for aliases', () => {
@@ -98,7 +98,7 @@ describe('Command', () => {
         variadic: false
       })
       handlers.foo.demanded.should.deep.equal([])
-      expect(handlers.wat).to.not.exist
+      expect(handlers.wat).to.equal(undefined)
       command.getCommands().should.deep.equal(['foo', 'wat'])
     })
 
@@ -106,7 +106,7 @@ describe('Command', () => {
       const argv = yargs('foo foo.js --reporter=html')
         .command('foo <file>')
         .default('reporter', 'text')
-        .argv
+        .parse()
       argv.file.should.equal('foo.js')
       argv.reporter.should.equal('html')
     })
@@ -116,7 +116,7 @@ describe('Command', () => {
     it('allows required arguments to be variadic', () => {
       const argv = yargs('foo /root file1 file2 file3')
         .command('foo <root> <files..>')
-        .argv
+        .parse()
 
       argv.root.should.equal('/root')
       argv.files.should.deep.equal(['file1', 'file2', 'file3'])
@@ -125,7 +125,7 @@ describe('Command', () => {
     it('allows optional arguments to be variadic', () => {
       const argv = yargs('foo /root file1 file2 file3')
         .command('foo <root> [files..]')
-        .argv
+        .parse()
 
       argv.root.should.equal('/root')
       argv.files.should.deep.equal(['file1', 'file2', 'file3'])
@@ -138,13 +138,13 @@ describe('Command', () => {
           err.should.match(/Not enough non-option arguments/)
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('does not fail if zero optional arguments are provided', () => {
       const argv = yargs('foo /root')
         .command('foo <root> [files...]')
-        .argv
+        .parse()
 
       argv.root.should.equal('/root')
       argv.files.should.deep.equal([])
@@ -153,7 +153,7 @@ describe('Command', () => {
     it('only allows the last argument to be variadic', () => {
       const argv = yargs('foo /root file1 file2')
         .command('foo <root..> <file>')
-        .argv
+        .parse()
 
       argv.root.should.equal('/root')
       argv.file.should.equal('file1')
@@ -169,7 +169,7 @@ describe('Command', () => {
           err.should.match(/got 1, need at least 2/)
           return done()
         })
-        .argv
+        .parse()
 
       argv.bar.should.equal('hello')
     })
@@ -177,7 +177,7 @@ describe('Command', () => {
     it('does not fail if optional argument is missing', () => {
       const argv = yargs('foo hello')
         .command('foo <bar> [awesome]')
-        .argv
+        .parse()
 
       expect(argv.awesome).to.equal(undefined)
       argv.bar.should.equal('hello')
@@ -508,10 +508,10 @@ describe('Command', () => {
   describe('commandDir', () => {
     it('supports relative dirs', () => {
       const r = checkOutput(() => yargs('--help').wrap(null)
-          .commandDir('fixtures/cmddir')
-          .argv)
-      r.should.have.property('exit').and.be.true
-      r.should.have.property('errors').with.length(0)
+        .commandDir('fixtures/cmddir')
+        .parse())
+      r.exit.should.equal(true)
+      r.errors.length.should.equal(0)
       r.should.have.property('logs')
       r.logs.join('\n').split(/\n+/).should.deep.equal([
         'usage [command]',
@@ -525,11 +525,10 @@ describe('Command', () => {
 
     it('supports nested subcommands', () => {
       const r = checkOutput(() => yargs('dream --help').wrap(null)
-          .commandDir('fixtures/cmddir')
-          .argv, [ './command' ])
-      r.should.have.property('exit').and.be.true
-      r.should.have.property('errors').with.length(0)
-      r.should.have.property('logs')
+        .commandDir('fixtures/cmddir')
+        .parse(), [ './command' ])
+      r.exit.should.equal(true)
+      r.errors.length.should.equal(0)
       r.logs[0].split(/\n+/).should.deep.equal([
         'command dream [command] [opts]',
         'Go to sleep and dream',
@@ -546,11 +545,10 @@ describe('Command', () => {
 
     it('supports a "recurse" boolean option', () => {
       const r = checkOutput(() => yargs('--help').wrap(null)
-          .commandDir('fixtures/cmddir', { recurse: true })
-          .argv)
-      r.should.have.property('exit').and.be.true
-      r.should.have.property('errors').with.length(0)
-      r.should.have.property('logs')
+        .commandDir('fixtures/cmddir', { recurse: true })
+        .parse())
+      r.exit.should.equal(true)
+      r.errors.length.should.equal(0)
       r.logs.join('\n').split(/\n+/).should.deep.equal([
         'usage [command]',
         'Commands:',
@@ -569,24 +567,23 @@ describe('Command', () => {
       let pathToFile
       let filename
       const r = checkOutput(() => yargs('--help').wrap(null)
-          .commandDir('fixtures/cmddir', {
-            visit (_commandObject, _pathToFile, _filename) {
-              commandObject = _commandObject
-              pathToFile = _pathToFile
-              filename = _filename
-              return false // exclude command
-            }
-          })
-          .argv)
+        .commandDir('fixtures/cmddir', {
+          visit (_commandObject, _pathToFile, _filename) {
+            commandObject = _commandObject
+            pathToFile = _pathToFile
+            filename = _filename
+            return false // exclude command
+          }
+        })
+        .parse())
       commandObject.should.have.property('command').and.equal('dream [command] [opts]')
       commandObject.should.have.property('desc').and.equal('Go to sleep and dream')
       commandObject.should.have.property('builder')
       commandObject.should.have.property('handler')
       pathToFile.should.contain(require('path').join('test', 'fixtures', 'cmddir', 'dream.js'))
       filename.should.equal('dream.js')
-      r.should.have.property('exit').and.be.true
-      r.should.have.property('errors').with.length(0)
-      r.should.have.property('logs')
+      r.exit.should.equal(true)
+      r.errors.length.should.equal(0)
       r.logs.join('\n').split(/\n+/).should.deep.equal([
         'Options:',
         '  --help     Show help  [boolean]',
@@ -596,10 +593,10 @@ describe('Command', () => {
 
     it('detects and ignores cyclic dir references', () => {
       const r = checkOutput(() => yargs('cyclic --help').wrap(null)
-          .commandDir('fixtures/cmddir_cyclic')
-          .argv, [ './command' ])
-      r.should.have.property('exit').and.be.true
-      r.should.have.property('errors').with.length(0)
+        .commandDir('fixtures/cmddir_cyclic')
+        .parse(), [ './command' ])
+      r.exit.should.equal(true)
+      r.errors.length.should.equal(0)
       r.should.have.property('logs')
       r.logs.join('\n').split(/\n+/).should.deep.equal([
         'command cyclic',
@@ -612,10 +609,10 @@ describe('Command', () => {
 
     it('derives \'command\' string from filename when not exported', () => {
       const r = checkOutput(() => yargs('--help').wrap(null)
-          .commandDir('fixtures/cmddir_noname')
-          .argv)
-      r.should.have.property('exit').and.be.true
-      r.should.have.property('errors').with.length(0)
+        .commandDir('fixtures/cmddir_noname')
+        .parse())
+      r.exit.should.equal(true)
+      r.errors.length.should.equal(0)
       r.should.have.property('logs')
       r.logs.join('\n').split(/\n+/).should.deep.equal([
         'usage [command]',
@@ -647,29 +644,29 @@ describe('Command', () => {
       }
 
       const helpCmd = checkOutput(() => yargs('help cmd')
-          .wrap(null)
-          .command(cmd)
-          .argv, [ './command' ])
+        .wrap(null)
+        .command(cmd)
+        .parse(), [ './command' ])
 
       const cmdHelp = checkOutput(() => yargs('cmd help')
-          .wrap(null)
-          .command(cmd)
-          .argv, [ './command' ])
+        .wrap(null)
+        .command(cmd)
+        .parse(), [ './command' ])
 
       const helpCmdSub = checkOutput(() => yargs('help cmd sub')
-          .wrap(null)
-          .command(cmd)
-          .argv, [ './command' ])
+        .wrap(null)
+        .command(cmd)
+        .parse(), [ './command' ])
 
       const cmdHelpSub = checkOutput(() => yargs('cmd help sub')
-          .wrap(null)
-          .command(cmd)
-          .argv, [ './command' ])
+        .wrap(null)
+        .command(cmd)
+        .parse(), [ './command' ])
 
       const cmdSubHelp = checkOutput(() => yargs('cmd sub help')
-          .wrap(null)
-          .command(cmd)
-          .argv, [ './command' ])
+        .wrap(null)
+        .command(cmd)
+        .parse(), [ './command' ])
 
       const expectedCmd = [
         'command cmd <sub>',
@@ -709,11 +706,11 @@ describe('Command', () => {
       .env('FUN_DIP')
       .global('stick') // this does not actually need to be global
       .command('eat', 'Adult supervision recommended', yargs => yargs.boolean('powder').exitProcess(false), (argv) => {
-        argv.should.have.property('powder').and.be.true
-        argv.should.have.property('stick').and.equal('yummy')
+        argv.powder.should.equal(true)
+        argv.stick.should.equal('yummy')
       })
       .exitProcess(false)
-      .argv
+      .parse()
   })
 
   // addresses https://github.com/yargs/yargs/issues/514.
@@ -726,7 +723,7 @@ describe('Command', () => {
       .command('bar', 'bar command', (yargs) => {
         output.push('bar')
       })
-      .argv
+      .parse()
 
     output.should.include('bar')
     output.should.not.include('foo')
@@ -774,27 +771,26 @@ describe('Command', () => {
       }, (argv) => {
         argv.should.have.property('someone').and.equal('Pat')
       })
-      .argv
+      .parse()
     argv.should.have.property('someone').and.equal('Pat')
   })
 
   it('allows builder function to parse argv without returning', () => {
     const argv = yargs('yo Jude')
       .command('yo <someone>', 'Send someone a yo', (yargs) => {
-        yargs.argv
+        yargs.parse()
       }, (argv) => {
         argv.should.have.property('someone').and.equal('Jude')
-      })
-      .argv
+      }).parse()
     argv.should.have.property('someone').and.equal('Jude')
   })
 
   it('allows builder function to return parsed argv', () => {
     const argv = yargs('yo Leslie')
-      .command('yo <someone>', 'Send someone a yo', yargs => yargs.argv, (argv) => {
+      .command('yo <someone>', 'Send someone a yo', yargs => yargs.parse(), (argv) => {
         argv.should.have.property('someone').and.equal('Leslie')
       })
-      .argv
+      .parse()
     argv.should.have.property('someone').and.equal('Leslie')
   })
 
@@ -818,16 +814,16 @@ describe('Command', () => {
         commandCalled = true
         argv.should.have.property('someone').and.equal('world')
       })
-      .argv
+      .parse()
     argv.should.have.property('someone').and.equal('world')
-    commandCalled.should.be.true
+    commandCalled.should.equal(true)
   })
 
   describe('positional aliases', () => {
     it('allows an alias to be defined for a required positional argument', () => {
       const argv = yargs('yo bcoe 113993')
         .command('yo <user | email> [ssn]', 'Send someone a yo')
-        .argv
+        .parse()
       argv.user.should.equal('bcoe')
       argv.email.should.equal('bcoe')
       argv.ssn.should.equal(113993)
@@ -839,7 +835,7 @@ describe('Command', () => {
         .command('yo [ssn|sin]', 'Send someone a yo', {}, (_argv) => {
           argv = _argv
         })
-        .argv
+        .parse()
       argv.ssn.should.equal(113993)
       argv.sin.should.equal(113993)
     })
@@ -865,7 +861,7 @@ describe('Command', () => {
           })
           .config('foo')
           .global('foo', false)
-          .argv
+          .parse()
       })
 
       it('loads config for command by default', (done) => {
@@ -875,7 +871,7 @@ describe('Command', () => {
             return done()
           })
           .config('foo')
-          .argv
+          .parse()
       })
     })
 
@@ -888,7 +884,7 @@ describe('Command', () => {
           })
           .implies('foo', 'bar')
           .global('foo', false)
-          .argv
+          .parse()
       })
 
       it('applies conflicts logic for command by default', (done) => {
@@ -899,7 +895,7 @@ describe('Command', () => {
             return done()
           })
           .conflicts('foo', 'bar')
-          .argv
+          .parse()
       })
 
       it('resets conflicts logic for command if global is false', (done) => {
@@ -911,7 +907,7 @@ describe('Command', () => {
           })
           .conflicts('foo', 'bar')
           .global('foo', false)
-          .argv
+          .parse()
       })
 
       it('applies custom checks globally by default', (done) => {
@@ -924,7 +920,7 @@ describe('Command', () => {
             done()
             return true
           })
-          .argv
+          .parse()
       })
 
       it('resets custom check if global is false', () => {
@@ -935,7 +931,7 @@ describe('Command', () => {
             checkCalled = true
             return true
           }, false)
-          .argv
+          .parse()
         checkCalled.should.equal(false)
       })
 
@@ -947,7 +943,7 @@ describe('Command', () => {
             return done()
           })
           .demandOption('bar')
-          .argv
+          .parse()
       })
     })
 
@@ -957,11 +953,11 @@ describe('Command', () => {
         yargs('hi')
           .command('hi', 'The hi command', (innerYargs) => {
             commandCalled = true
-            innerYargs.getStrict().should.be.false
+            innerYargs.getStrict().should.equal(false)
           })
-        yargs.getStrict().should.be.false
-        yargs.argv // parse and run command
-        commandCalled.should.be.true
+        yargs.getStrict().should.equal(false)
+        yargs.parse() // parse and run command
+        commandCalled.should.equal(true)
       })
 
       it('can be enabled just for a command', () => {
@@ -969,11 +965,11 @@ describe('Command', () => {
         yargs('hi')
           .command('hi', 'The hi command', (innerYargs) => {
             commandCalled = true
-            innerYargs.strict().getStrict().should.be.true
+            innerYargs.strict().getStrict().should.equal(true)
           })
-        yargs.getStrict().should.be.false
-        yargs.argv // parse and run command
-        commandCalled.should.be.true
+        yargs.getStrict().should.equal(false)
+        yargs.parse() // parse and run command
+        commandCalled.should.equal(true)
       })
 
       it('applies strict globally by default', () => {
@@ -982,11 +978,11 @@ describe('Command', () => {
           .strict()
           .command('hi', 'The hi command', (innerYargs) => {
             commandCalled = true
-            innerYargs.getStrict().should.be.true
+            innerYargs.getStrict().should.equal(true)
           })
-        yargs.getStrict().should.be.true
-        yargs.argv // parse and run command
-        commandCalled.should.be.true
+        yargs.getStrict().should.equal(true)
+        yargs.parse() // parse and run command
+        commandCalled.should.equal(true)
       })
 
       // address regression introduced in #766, thanks @nexdrew!
@@ -1016,14 +1012,14 @@ describe('Command', () => {
       it('allows a command to override global`', () => {
         let commandCalled = false
         yargs('hi')
-         .strict()
-         .command('hi', 'The hi command', (innerYargs) => {
-           commandCalled = true
-           innerYargs.strict(false).getStrict().should.be.false
-         })
-        yargs.getStrict().should.be.true
-        yargs.argv // parse and run command
-        commandCalled.should.be.true
+          .strict()
+          .command('hi', 'The hi command', (innerYargs) => {
+            commandCalled = true
+            innerYargs.strict(false).getStrict().should.equal(false)
+          })
+        yargs.getStrict().should.equal(true)
+        yargs.parse() // parse and run command
+        commandCalled.should.equal(true)
       })
 
       it('does not fire command if validation fails', (done) => {
@@ -1046,7 +1042,7 @@ describe('Command', () => {
         const argv = yargs('command --foo 1 2')
           .command('command', 'a command')
           .array('foo')
-          .argv
+          .parse()
         argv.foo.should.eql([1, 2])
       })
 
@@ -1055,7 +1051,7 @@ describe('Command', () => {
           .command('command', 'a command')
           .array('foo')
           .global('foo', false)
-          .argv
+          .parse()
         argv.foo.should.eql(1)
       })
 
@@ -1067,7 +1063,7 @@ describe('Command', () => {
             msg.should.match(/Choices: 33, 88/)
             return done()
           })
-          .argv
+          .parse()
       })
     })
 
@@ -1081,7 +1077,7 @@ describe('Command', () => {
             return done()
           })
           .alias('foo', 'bar')
-          .argv
+          .parse()
       })
 
       it('allows global application of alias to be disabled', (done) => {
@@ -1096,7 +1092,7 @@ describe('Command', () => {
             alias: 'bar',
             global: false
           })
-          .argv
+          .parse()
       })
     })
 
@@ -1109,7 +1105,7 @@ describe('Command', () => {
             return done()
           })
           .coerce('foo', arg => arg * 2)
-          .argv
+          .parse()
       })
 
       // addresses https://github.com/yargs/yargs/issues/794
@@ -1136,7 +1132,7 @@ describe('Command', () => {
             return done()
           })
           .default('snuh', 55)
-          .argv
+          .parse()
       })
     })
 
@@ -1206,7 +1202,7 @@ describe('Command', () => {
           argv.foo.should.equal('bar')
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('executes default command if undefined positional arguments and only command', (done) => {
@@ -1216,7 +1212,7 @@ describe('Command', () => {
           argv._.should.contain('baz')
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('executes default command if defined positional arguments and only command', (done) => {
@@ -1226,7 +1222,7 @@ describe('Command', () => {
           argv.target.should.equal('baz')
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('allows $0 as an alias for a default command', (done) => {
@@ -1235,7 +1231,7 @@ describe('Command', () => {
           argv.port.should.equal(9999)
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('does not execute default command if another command is provided', (done) => {
@@ -1246,7 +1242,7 @@ describe('Command', () => {
           argv.foo.should.equal('bar')
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('allows default command to be set as alias', (done) => {
@@ -1257,7 +1253,7 @@ describe('Command', () => {
           argv.foo.should.equal('bar')
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('allows command to be run when alias is default command', (done) => {
@@ -1268,7 +1264,7 @@ describe('Command', () => {
           argv.foo.should.equal('bar')
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('the last default command set should take precedence', (done) => {
@@ -1280,7 +1276,7 @@ describe('Command', () => {
           argv.foo.should.equal('bar')
           return done()
         })
-        .argv
+        .parse()
     })
 
     describe('strict', () => {
@@ -1294,7 +1290,7 @@ describe('Command', () => {
             describe: 'a foo command'
           })
           .strict()
-          .argv
+          .parse()
       })
 
       it('allows default command aliases, when strict mode is enabled', (done) => {
@@ -1309,7 +1305,7 @@ describe('Command', () => {
           .option('foo', {
             describe: 'a foo command'
           })
-          .argv
+          .parse()
       })
     })
   })
@@ -1326,7 +1322,7 @@ describe('Command', () => {
           describe: 'a foo command',
           demand: true
         })
-        .argv
+        .parse()
     })
     called.should.equal(false)
     r.errors.should.match(/Missing required argument/)
@@ -1338,7 +1334,7 @@ describe('Command', () => {
       .command('1', 'numeric command', (yargs) => {
         output.push('1')
       })
-      .argv
+      .parse()
     output.should.include('1')
   })
 
@@ -1404,7 +1400,7 @@ describe('Command', () => {
         expect(err).to.equal(error)
         done()
       })
-      .argv
+      .parse()
   })
 
   it('succeeds when the promise returned by the command handler resolves', (done) => {
@@ -1418,7 +1414,7 @@ describe('Command', () => {
       .fail((msg, err) => {
         return done(Error('should not have been called'))
       })
-      .argv
+      .parse()
 
     handler.then(called => {
       called.should.equal(true)
diff --git a/test/completion.js b/test/completion.js
index 75f59ef..8127416 100644
--- a/test/completion.js
+++ b/test/completion.js
@@ -16,11 +16,11 @@ describe('Completion', () => {
   describe('default completion behavior', () => {
     it('it returns a list of commands as completion suggestions', () => {
       const r = checkUsage(() => yargs(['./completion', '--get-yargs-completions', ''])
-          .command('foo', 'bar')
-          .command('apple', 'banana')
-          .completion()
-          .argv
-        )
+        .command('foo', 'bar')
+        .command('apple', 'banana')
+        .completion()
+        .argv
+      )
 
       r.logs.should.include('apple')
       r.logs.should.include('foo')
@@ -28,10 +28,10 @@ describe('Completion', () => {
 
     it('avoids repeating already included commands', () => {
       const r = checkUsage(() => yargs(['./completion', '--get-yargs-completions', 'apple'])
-          .command('foo', 'bar')
-          .command('apple', 'banana')
-          .argv
-        )
+        .command('foo', 'bar')
+        .command('apple', 'banana')
+        .argv
+      )
 
       // should not suggest foo for completion unless foo is subcommand of apple
       r.logs.should.not.include('apple')
@@ -39,13 +39,13 @@ describe('Completion', () => {
 
     it('avoids repeating already included options', () => {
       const r = checkUsage(() => yargs(['./completion', '--get-yargs-completions', './completion', '--foo', '--'])
-          .options({
-            foo: {describe: 'foo option'},
-            bar: {describe: 'bar option'}
-          })
-          .completion()
-          .argv
-        )
+        .options({
+          foo: {describe: 'foo option'},
+          bar: {describe: 'bar option'}
+        })
+        .completion()
+        .argv
+      )
 
       r.logs.should.include('--bar')
       r.logs.should.not.include('--foo')
@@ -53,13 +53,13 @@ describe('Completion', () => {
 
     it('avoids repeating options whose aliases are already included', () => {
       const r = checkUsage(() => yargs(['./completion', '--get-yargs-completions', './completion', '--f', '--'])
-            .options({
-              foo: {describe: 'foo option', alias: 'f'},
-              bar: {describe: 'bar option'}
-            })
-            .completion()
-            .argv
-          )
+        .options({
+          foo: {describe: 'foo option', alias: 'f'},
+          bar: {describe: 'bar option'}
+        })
+        .completion()
+        .argv
+      )
 
       r.logs.should.include('--bar')
       r.logs.should.not.include('--foo')
@@ -67,16 +67,16 @@ describe('Completion', () => {
 
     it('completes options for a command', () => {
       const r = checkUsage(() => yargs(['./completion', '--get-yargs-completions', 'foo', '--b'])
-          .command('foo', 'foo command', subYargs => subYargs.options({
-            bar: {
-              describe: 'bar option'
-            }
-          })
-            .help(true)
-            .version(false))
-          .completion()
-          .argv
-        )
+        .command('foo', 'foo command', subYargs => subYargs.options({
+          bar: {
+            describe: 'bar option'
+          }
+        })
+          .help(true)
+          .version(false))
+        .completion()
+        .argv
+      )
 
       r.logs.should.have.length(2)
       r.logs.should.include('--bar')
@@ -85,25 +85,25 @@ describe('Completion', () => {
 
     it('completes options for the correct command', () => {
       const r = checkUsage(() => yargs(['./completion', '--get-yargs-completions', 'cmd2', '--o'])
-          .help(false)
-          .version(false)
-          .command('cmd1', 'first command', (subYargs) => {
-            subYargs.options({
-              opt1: {
-                describe: 'first option'
-              }
-            })
+        .help(false)
+        .version(false)
+        .command('cmd1', 'first command', (subYargs) => {
+          subYargs.options({
+            opt1: {
+              describe: 'first option'
+            }
           })
-          .command('cmd2', 'second command', (subYargs) => {
-            subYargs.options({
-              opt2: {
-                describe: 'second option'
-              }
-            })
+        })
+        .command('cmd2', 'second command', (subYargs) => {
+          subYargs.options({
+            opt2: {
+              describe: 'second option'
+            }
           })
-          .completion()
-          .argv
-        )
+        })
+        .completion()
+        .argv
+      )
 
       r.logs.should.have.length(1)
       r.logs.should.include('--opt2')
@@ -111,11 +111,11 @@ describe('Completion', () => {
 
     it('does not complete hidden commands', () => {
       const r = checkUsage(() => yargs(['./completion', '--get-yargs-completions', 'cmd'])
-          .command('cmd1', 'first command')
-          .command('cmd2', false)
-          .completion('completion', false)
-          .argv
-        )
+        .command('cmd1', 'first command')
+        .command('cmd2', false)
+        .completion('completion', false)
+        .argv
+      )
 
       r.logs.should.have.length(1)
       r.logs.should.include('cmd1')
@@ -137,14 +137,14 @@ describe('Completion', () => {
 
     it('works if command has no options', () => {
       const r = checkUsage(() => yargs(['./completion', '--get-yargs-completions', 'foo', '--b'])
-          .help(false)
-          .version(false)
-          .command('foo', 'foo command', (subYargs) => {
-            subYargs.completion().argv
-          })
-          .completion()
-          .argv
-        )
+        .help(false)
+        .version(false)
+        .command('foo', 'foo command', (subYargs) => {
+          return subYargs.completion().parse()
+        })
+        .completion()
+        .argv
+      )
 
       r.logs.should.have.length(0)
     })
@@ -167,21 +167,21 @@ describe('Completion', () => {
   describe('generateCompletionScript()', () => {
     it('replaces application variable with $0 in script', () => {
       const r = checkUsage(() => yargs([])
-          .showCompletionScript(), ['ndm'])
+        .showCompletionScript(), ['ndm'])
 
       r.logs[0].should.match(/ndm --get-yargs-completions/)
     })
 
     it('replaces completion command variable with custom completion command in script', () => {
       const r = checkUsage(() => yargs([]).completion('flintlock')
-          .showCompletionScript(), ['ndm'])
+        .showCompletionScript(), ['ndm'])
 
       r.logs[0].should.match(/ndm flintlock >>/)
     })
 
     it('if $0 has a .js extension, a ./ prefix is added', () => {
       const r = checkUsage(() => yargs([])
-          .showCompletionScript(), ['test.js'])
+        .showCompletionScript(), ['test.js'])
 
       r.logs[0].should.match(/\.\/test.js --get-yargs-completions/)
     })
@@ -190,8 +190,8 @@ describe('Completion', () => {
   describe('completion()', () => {
     it('shows completion script if command registered with completion(cmd) is called', () => {
       const r = checkUsage(() => yargs(['completion'])
-          .completion('completion')
-          .argv, ['ndm'])
+        .completion('completion')
+        .argv, ['ndm'])
 
       r.logs[0].should.match(/ndm --get-yargs-completions/)
     })
@@ -221,12 +221,12 @@ describe('Completion', () => {
     it('if a promise is returned, completions can be asynchronous', (done) => {
       checkUsage((cb) => {
         yargs(['--get-yargs-completions'])
-        .completion('completion', (current, argv) => new Promise((resolve, reject) => {
-          setTimeout(() => {
-            resolve(['apple', 'banana'])
-          }, 10)
-        }))
-        .argv
+          .completion('completion', (current, argv) => new Promise((resolve, reject) => {
+            setTimeout(() => {
+              resolve(['apple', 'banana'])
+            }, 10)
+          }))
+          .parse()
       }, null, (err, r) => {
         if (err) throw err
         r.logs.should.include('apple')
@@ -238,12 +238,12 @@ describe('Completion', () => {
     it('if a promise is returned, errors are handled', (done) => {
       checkUsage(() => {
         yargs(['--get-yargs-completions'])
-        .completion('completion', (current, argv) => new Promise((resolve, reject) => {
-          setTimeout(() => {
-            reject(new Error('Test'))
-          }, 10)
-        }))
-        .argv
+          .completion('completion', (current, argv) => new Promise((resolve, reject) => {
+            setTimeout(() => {
+              reject(new Error('Test'))
+            }, 10)
+          }))
+          .parse()
       }, null, (err) => {
         err.message.should.equal('Test')
         return done()
@@ -253,12 +253,12 @@ describe('Completion', () => {
     it('if a callback parameter is provided, completions can be asynchronous', (done) => {
       checkUsage(() => {
         yargs(['--get-yargs-completions'])
-        .completion('completion', (current, argv, cb) => {
-          setTimeout(() => {
-            cb(['apple', 'banana'])
-          }, 10)
-        })
-        .argv
+          .completion('completion', (current, argv, completion) => {
+            setTimeout(() => {
+              completion(['apple', 'banana'])
+            }, 10)
+          })
+          .parse()
       }, null, (err, r) => {
         if (err) throw err
         r.logs.should.include('apple')
diff --git a/test/fixtures/issue-497.js b/test/fixtures/issue-497.js
index 8b5c0a3..0cda3b2 100755
--- a/test/fixtures/issue-497.js
+++ b/test/fixtures/issue-497.js
@@ -14,6 +14,6 @@ for (var i = 0; i < 1000; i++) {
   })
 }
 
-y.argv
+y.parse()
 
 console.log('never get here')
diff --git a/test/fixtures/opt-assignment-and-positional-command-arg.js b/test/fixtures/opt-assignment-and-positional-command-arg.js
index bcfe330..3c1e2b9 100755
--- a/test/fixtures/opt-assignment-and-positional-command-arg.js
+++ b/test/fixtures/opt-assignment-and-positional-command-arg.js
@@ -11,4 +11,4 @@ require('../../index')
       console.log(JSON.stringify({ _: argv._, foo: argv.foo, baz: argv.baz }))
     }
   )
-  .argv
+  .parse()
diff --git a/test/integration.js b/test/integration.js
index 232f493..1f4d0b3 100644
--- a/test/integration.js
+++ b/test/integration.js
@@ -32,7 +32,7 @@ describe('integration tests', () => {
       which('node', (err, resolvedPath) => {
         if (err) return done(err)
         testArgs(`${resolvedPath.replace('Program Files (x86)', 'Progra~2')
-                     .replace('Program Files', 'Progra~1')} bin.js`, [], done)
+          .replace('Program Files', 'Progra~1')} bin.js`, [], done)
       })
     })
 
@@ -40,7 +40,7 @@ describe('integration tests', () => {
       which('node', (err, resolvedPath) => {
         if (err) return done(err)
         testArgs(`${resolvedPath.replace('Program Files (x86)', 'Progra~2')
-                     .replace('Program Files', 'Progra~1')} bin.js`, [ 'q', 'r' ], done)
+          .replace('Program Files', 'Progra~1')} bin.js`, [ 'q', 'r' ], done)
       })
     })
   })
diff --git a/test/middleware.js b/test/middleware.js
index 9e5b72a..764b1b0 100644
--- a/test/middleware.js
+++ b/test/middleware.js
@@ -51,6 +51,6 @@ describe('middleware', () => {
         }
       )
       .exitProcess(false) // defaults to true.
-      .argv
+      .parse()
   })
 })
diff --git a/test/usage.js b/test/usage.js
index fb76b2b..8907e35 100644
--- a/test/usage.js
+++ b/test/usage.js
@@ -21,11 +21,11 @@ describe('usage tests', () => {
     describe('using .demand()', () => {
       it('should show an error along with the missing arguments on demand fail', () => {
         const r = checkUsage(() => yargs('-x 10 -z 20')
-            .usage('Usage: $0 -x NUM -y NUM')
-            .demand(['x', 'y'])
-            .wrap(null)
-            .argv
-          )
+          .usage('Usage: $0 -x NUM -y NUM')
+          .demand(['x', 'y'])
+          .wrap(null)
+          .parse()
+        )
         r.result.should.have.property('x', 10)
         r.result.should.have.property('z', 20)
         r.result.should.have.property('_').with.length(0)
@@ -39,17 +39,17 @@ describe('usage tests', () => {
           'Missing required argument: y'
         ])
         r.logs.should.have.length(0)
-        r.exit.should.be.ok
+        r.exit.should.equal(true)
       })
 
       it('missing argument message given if one command, but an argument not on the list is provided', () => {
         const r = checkUsage(() => yargs('wombat -w 10 -y 10')
-            .usage('Usage: $0 -w NUM -m NUM')
-            .demand(1, ['w', 'm'])
-            .strict()
-            .wrap(null)
-            .argv
-          )
+          .usage('Usage: $0 -w NUM -m NUM')
+          .demand(1, ['w', 'm'])
+          .strict()
+          .wrap(null)
+          .parse()
+        )
         r.result.should.have.property('w', 10)
         r.result.should.have.property('y', 10)
         r.result.should.have.property('_').with.length(1)
@@ -63,17 +63,17 @@ describe('usage tests', () => {
           'Missing required argument: m'
         ])
         r.logs.should.have.length(0)
-        r.exit.should.be.ok
+        r.exit.should.equal(true)
       })
 
       it('missing command message if all the required arguments exist, but not enough commands are provided', () => {
         const r = checkUsage(() => yargs('-w 10 -y 10')
-            .usage('Usage: $0 -w NUM -m NUM')
-            .demand(1, ['w', 'm'])
-            .strict()
-            .wrap(null)
-            .argv
-          )
+          .usage('Usage: $0 -w NUM -m NUM')
+          .demand(1, ['w', 'm'])
+          .strict()
+          .wrap(null)
+          .parse()
+        )
         r.result.should.have.property('w', 10)
         r.result.should.have.property('y', 10)
         r.result.should.have.property('_').with.length(0)
@@ -87,17 +87,17 @@ describe('usage tests', () => {
           'Not enough non-option arguments: got 0, need at least 1'
         ])
         r.logs.should.have.length(0)
-        r.exit.should.be.ok
+        r.exit.should.equal(true)
       })
 
       it('no failure occurs if the required arguments and the required number of commands are provided', () => {
         const r = checkUsage(() => yargs('wombat -w 10 -m 10')
-            .usage('Usage: $0 -w NUM -m NUM')
-            .command('wombat', 'wombat handlers')
-            .demand(1, ['w', 'm'])
-            .wrap(null)
-            .argv
-          )
+          .usage('Usage: $0 -w NUM -m NUM')
+          .command('wombat', 'wombat handlers')
+          .demand(1, ['w', 'm'])
+          .wrap(null)
+          .parse()
+        )
 
         r.result.should.have.property('w', 10)
         r.result.should.have.property('m', 10)
@@ -110,11 +110,11 @@ describe('usage tests', () => {
       describe('using .require()', () => {
         it('should show an error along with the missing arguments on demand fail', () => {
           const r = checkUsage(() => yargs('-x 10 -z 20')
-              .usage('Usage: $0 -x NUM -y NUM')
-              .require(['x', 'y'])
-              .wrap(null)
-              .argv
-            )
+            .usage('Usage: $0 -x NUM -y NUM')
+            .require(['x', 'y'])
+            .wrap(null)
+            .parse()
+          )
           r.result.should.have.property('x', 10)
           r.result.should.have.property('z', 20)
           r.result.should.have.property('_').with.length(0)
@@ -128,16 +128,16 @@ describe('usage tests', () => {
             'Missing required argument: y'
           ])
           r.logs.should.have.length(0)
-          r.exit.should.be.ok
+          r.exit.should.equal(true)
         })
         it('missing argument message given if one command and an argument not on the list are provided', () => {
           const r = checkUsage(() => yargs('wombat -w 10 -y 10')
-              .usage('Usage: $0 -w NUM -m NUM')
-              .required(1, ['w', 'm'])
-              .strict()
-              .wrap(null)
-              .argv
-            )
+            .usage('Usage: $0 -w NUM -m NUM')
+            .required(1, ['w', 'm'])
+            .strict()
+            .wrap(null)
+            .parse()
+          )
           r.result.should.have.property('w', 10)
           r.result.should.have.property('y', 10)
           r.result.should.have.property('_').with.length(1)
@@ -151,18 +151,18 @@ describe('usage tests', () => {
             'Missing required argument: m'
           ])
           r.logs.should.have.length(0)
-          r.exit.should.be.ok
+          r.exit.should.equal(true)
         })
       })
 
       it('missing command message if all the required arguments exist, but not enough commands are provided', () => {
         const r = checkUsage(() => yargs('-w 10 -y 10')
-            .usage('Usage: $0 -w NUM -m NUM')
-            .require(1, ['w', 'm'])
-            .strict()
-            .wrap(null)
-            .argv
-          )
+          .usage('Usage: $0 -w NUM -m NUM')
+          .require(1, ['w', 'm'])
+          .strict()
+          .wrap(null)
+          .parse()
+        )
         r.result.should.have.property('w', 10)
         r.result.should.have.property('y', 10)
         r.result.should.have.property('_').with.length(0)
@@ -176,7 +176,7 @@ describe('usage tests', () => {
           'Not enough non-option arguments: got 0, need at least 1'
         ])
         r.logs.should.have.length(0)
-        r.exit.should.be.ok
+        r.exit.should.equal(true)
       })
     })
 
@@ -185,7 +185,7 @@ describe('usage tests', () => {
         .usage('Usage: $0 -x NUM -y NUM')
         .demand(['x', 'y'], 'x and y are both required to multiply all the things')
         .wrap(null)
-        .argv
+        .parse()
       )
       r.result.should.have.property('z', 20)
       r.result.should.have.property('_').with.length(0)
@@ -200,7 +200,7 @@ describe('usage tests', () => {
         'x and y are both required to multiply all the things'
       ])
       r.logs.should.have.length(0)
-      r.exit.should.be.ok
+      r.exit.should.equal(true)
     })
 
     it('should return valid values when demand passes', () => {
@@ -208,7 +208,7 @@ describe('usage tests', () => {
         .usage('Usage: $0 -x NUM -y NUM')
         .demand(['x', 'y'])
         .wrap(null)
-        .argv
+        .parse()
       )
       r.should.have.property('result')
       r.result.should.have.property('x', 10)
@@ -221,11 +221,11 @@ describe('usage tests', () => {
 
     it('should not show a custom message if msg is null', () => {
       const r = checkUsage(() => yargs('')
-          .usage('Usage: foo')
-          .demand(1, null)
-          .wrap(null)
-          .argv
-        )
+        .usage('Usage: foo')
+        .demand(1, null)
+        .wrap(null)
+        .parse()
+      )
 
       r.errors.join('\n').split(/\n+/).should.deep.equal([
         'Usage: foo',
@@ -240,22 +240,22 @@ describe('usage tests', () => {
     describe('min/max demanded count', () => {
       it("does not output an error if '_' count is within the min/max range", () => {
         const r = checkUsage(() => yargs(['foo', 'bar', 'apple'])
-            .usage('Usage: foo')
-            .demand(2, 3)
-            .wrap(null)
-            .argv
-          )
+          .usage('Usage: foo')
+          .demand(2, 3)
+          .wrap(null)
+          .parse()
+        )
 
         r.errors.length.should.equal(0)
       })
 
       it("outputs an error if '_' count is above max", () => {
         const r = checkUsage(() => yargs(['foo', 'bar', 'apple', 'banana'])
-            .usage('Usage: foo')
-            .demand(2, 3)
-            .wrap(null)
-            .argv
-          )
+          .usage('Usage: foo')
+          .demand(2, 3)
+          .wrap(null)
+          .parse()
+        )
 
         r.errors.join('\n').split(/\n+/).should.deep.equal([
           'Usage: foo',
@@ -268,11 +268,11 @@ describe('usage tests', () => {
 
       it("outputs an error if '_' count is below min", () => {
         const r = checkUsage(() => yargs(['foo'])
-            .usage('Usage: foo')
-            .demand(2, 3)
-            .wrap(null)
-            .argv
-          )
+          .usage('Usage: foo')
+          .demand(2, 3)
+          .wrap(null)
+          .parse()
+        )
 
         r.errors.join('\n').split(/\n+/).should.deep.equal([
           'Usage: foo',
@@ -285,11 +285,11 @@ describe('usage tests', () => {
 
       it('allows a customer error message to be provided', () => {
         const r = checkUsage(() => yargs(['foo'])
-            .usage('Usage: foo')
-            .demand(2, 3, 'pork chop sandwiches')
-            .wrap(null)
-            .argv
-          )
+          .usage('Usage: foo')
+          .demand(2, 3, 'pork chop sandwiches')
+          .wrap(null)
+          .parse()
+        )
 
         r.errors.join('\n').split(/\n+/).should.deep.equal([
           'Usage: foo',
@@ -302,11 +302,11 @@ describe('usage tests', () => {
 
       it("shouldn't interpret the second argument as a max when it is an array", () => {
         const r = checkUsage(() => yargs(['koala', 'wombat', '--1'])
-              .usage('Usage: foo')
-              .demand(1, ['1'])
-              .wrap(null)
-              .argv
-            )
+          .usage('Usage: foo')
+          .demand(1, ['1'])
+          .wrap(null)
+          .parse()
+        )
 
         r.errors.length.should.equal(0)
       })
@@ -321,7 +321,7 @@ describe('usage tests', () => {
         if (!('y' in argv)) throw Error('You forgot about -y')
         else return true
       })
-      .argv
+      .parse()
     )
     r.should.have.property('result')
     r.result.should.have.property('x', 10)
@@ -334,14 +334,14 @@ describe('usage tests', () => {
 
   it('should display missing arguments when check fails with a thrown exception', () => {
     const r = checkUsage(() => yargs('-x 10 -z 20')
-        .usage('Usage: $0 -x NUM -y NUM')
-        .wrap(null)
-        .check((argv) => {
-          if (!('x' in argv)) throw Error('You forgot about -x')
-          if (!('y' in argv)) throw Error('You forgot about -y')
-        })
-        .argv
-      )
+      .usage('Usage: $0 -x NUM -y NUM')
+      .wrap(null)
+      .check((argv) => {
+        if (!('x' in argv)) throw Error('You forgot about -x')
+        if (!('y' in argv)) throw Error('You forgot about -y')
+      })
+      .parse()
+    )
     r.should.have.property('result')
     r.result.should.have.property('x', 10)
     r.result.should.have.property('z', 20)
@@ -354,7 +354,7 @@ describe('usage tests', () => {
       'You forgot about -y'
     ])
     r.should.have.property('logs').with.length(0)
-    r.should.have.property('exit').and.be.ok
+    r.should.have.property('exit').and.equal(true)
   })
 
   it('should display missing arguments when check fails with a return value', () => {
@@ -365,14 +365,14 @@ describe('usage tests', () => {
         if (!('x' in argv)) return 'You forgot about -x'
         if (!('y' in argv)) return 'You forgot about -y'
       })
-      .argv
+      .parse()
     )
     r.should.have.property('result')
     r.result.should.have.property('x', 10)
     r.result.should.have.property('z', 20)
     r.result.should.have.property('_').with.length(0)
     r.should.have.property('logs').with.length(0)
-    r.should.have.property('exit').and.be.ok
+    r.should.have.property('exit').and.equal(true)
     r.should.have.property('errors')
     r.errors.join('\n').split(/\n+/).should.deep.equal([
       'Usage: usage -x NUM -y NUM',
@@ -390,7 +390,7 @@ describe('usage tests', () => {
     const r = checkUsage(() => yargs('-x 10 -y 20')
       .usage('Usage: $0 -x NUM -y NUM')
       .check(checker)
-      .argv
+      .parse()
     )
     r.should.have.property('result')
     r.result.should.have.property('x', 10)
@@ -409,14 +409,14 @@ describe('usage tests', () => {
       .usage('Usage: $0 -x NUM -y NUM')
       .check(checker)
       .wrap(null)
-      .argv
+      .parse()
     )
     r.should.have.property('result')
     r.result.should.have.property('x', 10)
     r.result.should.have.property('z', 20)
     r.result.should.have.property('_').with.length(0)
     r.should.have.property('logs').with.length(0)
-    r.should.have.property('exit').and.be.ok
+    r.should.have.property('exit').and.equal(true)
     r.should.have.property('errors')
     r.errors.join('\n').split(/\n+/).join('\n').should.equal(
       'Usage: usage -x NUM -y NUM\n' +
@@ -440,7 +440,7 @@ describe('usage tests', () => {
                 if (!('x' in argv)) throw Error('You forgot about -x')
                 if (!('y' in argv)) throw Error('You forgot about -y')
               })
-              .argv
+              .parse()
           } catch (err) {
             // ignore the error, we only test the output here
           }
@@ -453,7 +453,7 @@ describe('usage tests', () => {
           'You forgot about -y'
         ])
         r.should.have.property('logs').with.length(0)
-        r.should.have.property('exit').and.be.false
+        r.should.have.property('exit').and.equal(false)
       })
     })
     describe('fail()', () => {
@@ -469,31 +469,31 @@ describe('usage tests', () => {
               .check((argv) => {
                 throw new Error('foo')
               })
-              .argv
+              .parse()
           } catch (error) {
 
           }
         })
         r.logs.should.deep.equal(['foo'])
-        r.should.have.property('exit').and.be.false
+        r.should.have.property('exit').and.equal(false)
       })
 
       it('is invoked with yargs instance as third argument', () => {
         const r = checkUsage(() => yargs('foo')
-            .command('foo', 'desc', {
-              bar: {
-                describe: 'bar command'
-              }
-            }, (argv) => {
-              throw new YError('blah')
-            })
-            .fail((message, error, yargs) => {
-              yargs.showHelp()
-            })
-            .exitProcess(false)
-            .wrap(null)
-            .argv
-          )
+          .command('foo', 'desc', {
+            bar: {
+              describe: 'bar command'
+            }
+          }, (argv) => {
+            throw new YError('blah')
+          })
+          .fail((message, error, yargs) => {
+            yargs.showHelp()
+          })
+          .exitProcess(false)
+          .wrap(null)
+          .parse()
+        )
 
         r.errors[0].should.contain('bar command')
       })
@@ -511,13 +511,13 @@ describe('usage tests', () => {
                 .check(() => {
                   throw new Error('foo')
                 })
-                .argv
+                .parse()
             } catch (error) {
 
             }
           })
           r.logs.should.deep.equal(['foo'])
-          r.should.have.property('exit').and.be.false
+          r.should.have.property('exit').and.equal(false)
         })
       })
       describe('when command() throws error', () => {
@@ -539,13 +539,13 @@ describe('usage tests', () => {
                 }, (argv) => {
                   throw new YError('foo')
                 })
-                .argv
+                .parse()
             } catch (error) {
 
             }
           })
           r.logs.should.deep.equal([['YError', 'foo'], 'is triggered last'])
-          r.should.have.property('exit').and.be.false
+          r.should.have.property('exit').and.equal(false)
         })
       })
     })
@@ -555,7 +555,7 @@ describe('usage tests', () => {
     const r = checkUsage(() => yargs('1 2 3 --moo')
       .usage('Usage: $0 [x] [y] [z] {OPTIONS}')
       .demand(3)
-      .argv
+      .parse()
     )
     r.should.have.property('result')
     r.should.have.property('errors').with.length(0)
@@ -570,11 +570,11 @@ describe('usage tests', () => {
       .usage('Usage: $0 [x] [y] [z] {OPTIONS}')
       .demand(3)
       .wrap(null)
-      .argv
+      .parse()
     )
     r.should.have.property('result')
     r.should.have.property('logs').with.length(0)
-    r.should.have.property('exit').and.be.ok
+    r.should.have.property('exit').and.equal(true)
     r.result.should.have.property('_').and.deep.equal([1, 2])
     r.result.should.have.property('moo', true)
     r.should.have.property('errors')
@@ -592,11 +592,11 @@ describe('usage tests', () => {
       .usage('Usage: $0 [x] [y] [z] {OPTIONS} <src> <dest> [extra_files...]')
       .demand(2, 'src and dest files are both required')
       .wrap(null)
-      .argv
+      .parse()
     )
     r.should.have.property('result')
     r.should.have.property('logs').with.length(0)
-    r.should.have.property('exit').and.be.ok
+    r.should.have.property('exit').and.equal(true)
     r.result.should.have.property('_').and.deep.equal(['src'])
     r.result.should.have.property('moo', true)
     r.should.have.property('errors')
@@ -614,7 +614,7 @@ describe('usage tests', () => {
       .default('foo', 5)
       .default('bar', 6)
       .default('baz', 7)
-      .argv
+      .parse()
     )
     r.should.have.property('result')
     r.result.should.have.property('foo', 50)
@@ -628,7 +628,7 @@ describe('usage tests', () => {
     const r = checkUsage(() => yargs('')
       .alias('f', 'foo')
       .default('f', 5)
-      .argv
+      .parse()
     )
     r.should.have.property('result')
     r.result.should.have.property('f', 5)
@@ -638,12 +638,12 @@ describe('usage tests', () => {
 
   it('should print a single line when failing and default is set for an alias', () => {
     const r = checkUsage(() => yargs('')
-        .alias('f', 'foo')
-        .default('f', 5)
-        .demand(1)
-        .wrap(null)
-        .argv
-      )
+      .alias('f', 'foo')
+      .default('f', 5)
+      .demand(1)
+      .wrap(null)
+      .parse()
+    )
     r.errors.join('\n').split(/\n+/).should.deep.equal([
       'Options:',
       '  --help     Show help  [boolean]',
@@ -656,7 +656,7 @@ describe('usage tests', () => {
   it('should allow you to set default values for a hash of options', () => {
     const r = checkUsage(() => yargs('--foo 50 --baz 70')
       .default({ foo: 10, bar: 20, quux: 30 })
-      .argv
+      .parse()
     )
     r.should.have.property('result')
     r.result.should.have.property('_').with.length(0)
@@ -676,16 +676,16 @@ describe('usage tests', () => {
           }
 
           return yargs('-f --bar 20')
-          .usage('Usage: $0 [options]')
-          .options(opts)
-          .wrap(null)
-          .argv
+            .usage('Usage: $0 [options]')
+            .options(opts)
+            .wrap(null)
+            .parse()
         })
         r.should.have.property('result')
         r.result.should.have.property('_').with.length(0)
         r.should.have.property('errors')
         r.should.have.property('logs').with.length(0)
-        r.should.have.property('exit').and.be.ok
+        r.should.have.property('exit').and.equal(true)
         r.errors.join('\n').split(/\n+/).should.deep.equal([
           'Usage: usage [options]',
           'Options:',
@@ -705,16 +705,16 @@ describe('usage tests', () => {
           }
 
           return yargs('-f --bar')
-          .usage('Usage: $0 [options]')
-          .options(opts)
-          .wrap(null)
-          .argv
+            .usage('Usage: $0 [options]')
+            .options(opts)
+            .wrap(null)
+            .parse()
         })
         r.should.have.property('result')
         r.result.should.have.property('_').with.length(0)
         r.should.have.property('errors')
         r.should.have.property('logs').with.length(0)
-        r.should.have.property('exit').and.be.ok
+        r.should.have.property('exit').and.equal(true)
         r.errors.join('\n').split(/\n+/).should.deep.equal([
           'Usage: usage [options]',
           'Options:',
@@ -736,17 +736,17 @@ describe('usage tests', () => {
           }
 
           return yargs('-f --bar 20')
-          .usage('Usage: $0 [options]')
-          .options(opts)
-          .requiresArg(['foo', 'bar'])
-          .wrap(null)
-          .argv
+            .usage('Usage: $0 [options]')
+            .options(opts)
+            .requiresArg(['foo', 'bar'])
+            .wrap(null)
+            .parse()
         })
         r.should.have.property('result')
         r.result.should.have.property('_').with.length(0)
         r.should.have.property('errors')
         r.should.have.property('logs').with.length(0)
-        r.should.have.property('exit').and.be.ok
+        r.should.have.property('exit').and.equal(true)
         r.errors.join('\n').split(/\n+/).should.deep.equal([
           'Usage: usage [options]',
           'Options:',
@@ -761,13 +761,13 @@ describe('usage tests', () => {
 
     it("still requires argument if 'type' hints are given", () => {
       const r = checkUsage(() => yargs('--foo --bar')
-          .requiresArg('foo')
-          .string('foo')
-          .requiresArg('bar')
-          .array('bar')
-          .wrap(null)
-          .argv
-        )
+        .requiresArg('foo')
+        .string('foo')
+        .requiresArg('bar')
+        .array('bar')
+        .wrap(null)
+        .parse()
+      )
 
       r.errors[2].should.equal('Not enough arguments following: bar')
     })
@@ -782,11 +782,11 @@ describe('usage tests', () => {
         }
 
         return yargs('-f 10 --bar 20 --baz 30')
-        .usage('Usage: $0 [options]')
-        .options(opts)
-        .strict()
-        .wrap(null)
-        .argv
+          .usage('Usage: $0 [options]')
+          .options(opts)
+          .strict()
+          .wrap(null)
+          .parse()
       })
 
       r.should.have.property('result')
@@ -807,7 +807,7 @@ describe('usage tests', () => {
         'Unknown argument: baz'
       ])
       r.should.have.property('logs').with.length(0)
-      r.should.have.property('exit').and.be.ok
+      r.should.have.property('exit').and.equal(true)
     })
 
     it('should fail given an option argument without a corresponding description', () => {
@@ -818,11 +818,11 @@ describe('usage tests', () => {
         }
 
         return yargs('-f 10 --bar 20 --baz 30')
-        .usage('Usage: $0 [options]')
-        .options(opts)
-        .strict()
-        .wrap(null)
-        .argv
+          .usage('Usage: $0 [options]')
+          .options(opts)
+          .strict()
+          .wrap(null)
+          .parse()
       })
 
       r.should.have.property('result')
@@ -843,7 +843,7 @@ describe('usage tests', () => {
         'Unknown argument: baz'
       ])
       r.should.have.property('logs').with.length(0)
-      r.should.have.property('exit').and.be.ok
+      r.should.have.property('exit').and.equal(true)
     })
 
     it('should fail given multiple option arguments without corresponding descriptions', () => {
@@ -858,7 +858,7 @@ describe('usage tests', () => {
           .options(opts)
           .strict()
           .wrap(null)
-          .argv
+          .parse()
       })
 
       r.should.have.property('result')
@@ -880,7 +880,7 @@ describe('usage tests', () => {
         'Unknown arguments: baz, q'
       ])
       r.should.have.property('logs').with.length(0)
-      r.should.have.property('exit').and.be.ok
+      r.should.have.property('exit').and.equal(true)
     })
 
     it('should pass given option arguments with corresponding descriptions', () => {
@@ -894,7 +894,7 @@ describe('usage tests', () => {
           .usage('Usage: $0 [options]')
           .options(opts)
           .strict()
-          .argv
+          .parse()
       })
 
       r.should.have.property('result')
@@ -909,17 +909,17 @@ describe('usage tests', () => {
 
   it('should display example on fail', () => {
     const r = checkUsage(() => yargs('')
-        .example('$0 something', 'description')
-        .example('$0 something else', 'other description')
-        .demand(['y'])
-        .wrap(null)
-        .argv
-      )
+      .example('$0 something', 'description')
+      .example('$0 something else', 'other description')
+      .demand(['y'])
+      .wrap(null)
+      .parse()
+    )
     r.should.have.property('result')
     r.result.should.have.property('_').with.length(0)
     r.should.have.property('errors')
     r.should.have.property('logs').with.length(0)
-    r.should.have.property('exit').and.be.ok
+    r.should.have.property('exit').and.equal(true)
     r.errors.join('\n').split(/\n+/).should.deep.equal([
       'Options:',
       '  --help     Show help  [boolean]',
@@ -936,14 +936,14 @@ describe('usage tests', () => {
     describe('with demand option', () => {
       it('should report missing required arguments', () => {
         const r = checkUsage(() => yargs('-y 10 -z 20')
-            .usage('Usage: $0 -x NUM [-y NUM]')
-            .options({
-              'x': { description: 'an option', demand: true },
-              'y': { description: 'another option', demand: false }
-            })
-            .wrap(null)
-            .argv
-          )
+          .usage('Usage: $0 -x NUM [-y NUM]')
+          .options({
+            'x': { description: 'an option', demand: true },
+            'y': { description: 'another option', demand: false }
+          })
+          .wrap(null)
+          .parse()
+        )
         r.result.should.have.property('y', 10)
         r.result.should.have.property('z', 20)
         r.result.should.have.property('_').with.length(0)
@@ -959,21 +959,21 @@ describe('usage tests', () => {
           'Missing required argument: x'
         ])
         r.logs.should.have.length(0)
-        r.exit.should.be.ok
+        r.exit.should.equal(true)
       })
     })
 
     describe('with required option', () => {
       it('should report missing required arguments', () => {
         const r = checkUsage(() => yargs('-y 10 -z 20')
-            .usage('Usage: $0 -x NUM [-y NUM]')
-            .options({
-              'x': { description: 'an option', required: true },
-              'y': { description: 'another option', required: false }
-            })
-            .wrap(null)
-            .argv
-          )
+          .usage('Usage: $0 -x NUM [-y NUM]')
+          .options({
+            'x': { description: 'an option', required: true },
+            'y': { description: 'another option', required: false }
+          })
+          .wrap(null)
+          .parse()
+        )
         r.result.should.have.property('y', 10)
         r.result.should.have.property('z', 20)
         r.result.should.have.property('_').with.length(0)
@@ -989,7 +989,7 @@ describe('usage tests', () => {
           'Missing required argument: x'
         ])
         r.logs.should.have.length(0)
-        r.exit.should.be.ok
+        r.exit.should.equal(true)
       })
     })
 
@@ -1001,7 +1001,7 @@ describe('usage tests', () => {
           'height': { description: 'Height', alias: 'h', demand: false }
         })
         .wrap(null)
-        .argv
+        .parse()
       )
       r.result.should.have.property('w', 10)
       r.result.should.have.property('_').with.length(0)
@@ -1013,15 +1013,15 @@ describe('usage tests', () => {
   describe('help option', () => {
     it('should display usage', () => {
       const r = checkUsage(() => yargs(['--help'])
-          .demand(['y'])
-          .wrap(null)
-          .argv
-        )
+        .demand(['y'])
+        .wrap(null)
+        .parse()
+      )
       r.should.have.property('result')
       r.result.should.have.property('_').with.length(0)
       r.should.have.property('errors')
       r.should.have.property('logs').with.length(1)
-      r.should.have.property('exit').and.be.ok
+      r.should.have.property('exit').and.equal(true)
       r.logs.join('\n').split(/\n+/).should.deep.equal([
         'Options:',
         '  --help     Show help  [boolean]',
@@ -1032,15 +1032,15 @@ describe('usage tests', () => {
 
     it('should not show both dashed and camelCase aliases', () => {
       const r = checkUsage(() => yargs(['--help'])
-          .usage('Usage: $0 options')
-          .describe('some-opt', 'Some option')
-          .default('some-opt', 2)
-          .wrap(null)
-          .argv
-        )
+        .usage('Usage: $0 options')
+        .describe('some-opt', 'Some option')
+        .default('some-opt', 2)
+        .wrap(null)
+        .parse()
+      )
       r.should.have.property('result')
       r.result.should.have.property('_').with.length(0)
-      r.should.have.property('exit').and.be.ok
+      r.should.have.property('exit').and.equal(true)
       r.should.have.property('errors').with.length(0)
       r.should.have.property('logs')
       r.logs.join('\n').split(/\n+/).should.deep.equal([
@@ -1055,19 +1055,19 @@ describe('usage tests', () => {
     describe('when exitProcess is false', () => {
       it('should not validate arguments (required argument)', () => {
         const r = checkUsage(() => yargs(['--help'])
-            .usage('Usage: $0 options')
-            .alias('help', 'h')
-            .describe('some-opt', 'Some option')
-            .demand('some-opt')
-            .wrap(null)
-            .exitProcess(false)
-            .argv
-          )
+          .usage('Usage: $0 options')
+          .alias('help', 'h')
+          .describe('some-opt', 'Some option')
+          .demand('some-opt')
+          .wrap(null)
+          .exitProcess(false)
+          .parse()
+        )
         r.should.have.property('result')
         r.result.should.have.property('_').with.length(0)
-        r.result.should.have.property('help').and.be.true
-        r.result.should.have.property('h').and.be.true
-        r.should.have.property('exit').and.be.false
+        r.result.should.have.property('help').and.equal(true)
+        r.result.should.have.property('h').and.equal(true)
+        r.should.have.property('exit').and.equal(false)
         r.should.have.property('errors').with.length(0)
         r.should.have.property('logs')
         r.logs.join('\n').split(/\n+/).should.deep.equal([
@@ -1083,20 +1083,20 @@ describe('usage tests', () => {
       // is a validation error and nargs is a parse error
       it('should not validate arguments (nargs)', () => {
         const r = checkUsage(() => yargs(['--help', '--some-opt'])
-            .usage('Usage: $0 options')
-            .alias('help', 'h')
-            .describe('some-opt', 'Some option')
-            .demand('some-opt')
-            .nargs('some-opt', 3)
-            .wrap(null)
-            .exitProcess(false)
-            .argv
-          )
+          .usage('Usage: $0 options')
+          .alias('help', 'h')
+          .describe('some-opt', 'Some option')
+          .demand('some-opt')
+          .nargs('some-opt', 3)
+          .wrap(null)
+          .exitProcess(false)
+          .parse()
+        )
         r.should.have.property('result')
         r.result.should.have.property('_').with.length(0)
-        r.result.should.have.property('help').and.be.true
-        r.result.should.have.property('h').and.be.true
-        r.should.have.property('exit').and.be.false
+        r.result.should.have.property('help').and.equal(true)
+        r.result.should.have.property('h').and.equal(true)
+        r.should.have.property('exit').and.equal(false)
         r.should.have.property('errors').with.length(0)
         r.should.have.property('logs')
         r.logs.join('\n').split(/\n+/).should.deep.equal([
@@ -1115,13 +1115,13 @@ describe('usage tests', () => {
       const r = checkUsage(() => yargs(['--version'])
         .version('version', 'Show version number', '1.0.1')
         .wrap(null)
-        .argv
+        .parse()
       )
       r.should.have.property('result')
       r.result.should.have.property('_').with.length(0)
       r.should.have.property('errors')
       r.should.have.property('logs').with.length(1)
-      r.should.have.property('exit').and.be.ok
+      r.should.have.property('exit').and.equal(true)
       r.logs[0].should.eql('1.0.1')
     })
 
@@ -1129,7 +1129,7 @@ describe('usage tests', () => {
       const r = checkUsage(() => yargs(['--version'])
         .version('version', '1.0.0')
         .wrap(null)
-        .argv
+        .parse()
       )
       r.logs[0].should.eql('1.0.0')
     })
@@ -1138,7 +1138,7 @@ describe('usage tests', () => {
       const r = checkUsage(() => yargs(['--version'])
         .version('1.0.2')
         .wrap(null)
-        .argv
+        .parse()
       )
       r.logs[0].should.eql('1.0.2')
     })
@@ -1146,16 +1146,16 @@ describe('usage tests', () => {
     describe('when exitProcess is false', () => {
       it('should not validate arguments (required argument)', () => {
         const r = checkUsage(() => yargs(['--version'])
-            .version('version', 'Show version number', '1.0.1')
-            .demand('some-opt')
-            .wrap(null)
-            .exitProcess(false)
-            .argv
-          )
+          .version('version', 'Show version number', '1.0.1')
+          .demand('some-opt')
+          .wrap(null)
+          .exitProcess(false)
+          .parse()
+        )
         r.should.have.property('result')
         r.result.should.have.property('_').with.length(0)
-        r.result.should.have.property('version').and.be.true
-        r.should.have.property('exit').and.be.false
+        r.result.should.have.property('version').and.equal(true)
+        r.should.have.property('exit').and.equal(false)
         r.should.have.property('errors').with.length(0)
         r.should.have.property('logs')
         r.logs[0].should.eql('1.0.1')
@@ -1165,16 +1165,16 @@ describe('usage tests', () => {
       // is a validation error and nargs is a parse error
       it('should not validate arguments (nargs)', () => {
         const r = checkUsage(() => yargs(['--version', '--some-opt'])
-            .nargs('some-opt', 3)
-            .version('version', 'Show version number', '1.0.1')
-            .wrap(null)
-            .exitProcess(false)
-            .argv
-          )
+          .nargs('some-opt', 3)
+          .version('version', 'Show version number', '1.0.1')
+          .wrap(null)
+          .exitProcess(false)
+          .parse()
+        )
         r.should.have.property('result')
         r.result.should.have.property('_').with.length(0)
-        r.result.should.have.property('version').and.be.true
-        r.should.have.property('exit').and.be.false
+        r.result.should.have.property('version').and.equal(true)
+        r.should.have.property('exit').and.equal(false)
         r.should.have.property('errors').with.length(0)
         r.should.have.property('logs')
         r.logs[0].should.eql('1.0.1')
@@ -1190,18 +1190,18 @@ describe('usage tests', () => {
       }
 
       const r = checkUsage(() => yargs(['--foo'])
-          .usage('Usage: $0 [options]')
-          .options(opts)
-          .demand(['foo', 'bar'])
-          .showHelpOnFail(false, 'Specify --help for available options')
-          .wrap(null)
-          .argv
-        )
+        .usage('Usage: $0 [options]')
+        .options(opts)
+        .demand(['foo', 'bar'])
+        .showHelpOnFail(false, 'Specify --help for available options')
+        .wrap(null)
+        .parse()
+      )
       r.should.have.property('result')
       r.result.should.have.property('_').with.length(0)
       r.should.have.property('errors')
       r.should.have.property('logs').with.length(0)
-      r.should.have.property('exit').and.be.ok
+      r.should.have.property('exit').and.equal(true)
       r.errors.join('\n').split(/\n/).should.deep.equal([
         'Missing required argument: bar',
         '',
@@ -1217,18 +1217,18 @@ describe('usage tests', () => {
       }
 
       const r = checkUsage(() => yargs(['--foo'])
-          .exitProcess(false)
-          .usage('Usage: $0 [options]')
-          .options(opts)
-          .demand(['foo'])
-          .wrap(null)
-          .argv
-        )
+        .exitProcess(false)
+        .usage('Usage: $0 [options]')
+        .options(opts)
+        .demand(['foo'])
+        .wrap(null)
+        .parse()
+      )
       r.should.have.property('result')
       r.result.should.have.property('_').with.length(0)
       r.should.have.property('errors')
       r.should.have.property('logs').with.length(0)
-      r.should.have.property('exit').and.be.false
+      r.should.have.property('exit').and.equal(false)
     })
   })
 
@@ -1239,13 +1239,13 @@ describe('usage tests', () => {
   })
 
   it('should not print usage string if help() is called without arguments', () => {
-    const r = checkUsage(() => yargs([]).usage('foo').help().argv)
+    const r = checkUsage(() => yargs([]).usage('foo').help().parse())
 
     r.logs.length.should.equal(0)
   })
 
   it('should add --help as an option for printing usage text if help() is called without arguments', () => {
-    const r = checkUsage(() => yargs(['--help']).usage('foo').help().argv)
+    const r = checkUsage(() => yargs(['--help']).usage('foo').help().parse())
 
     r.logs.length.should.not.equal(0)
   })
@@ -1260,7 +1260,7 @@ describe('usage tests', () => {
         })
         .demand('foo')
         .wrap(50)
-        .argv
+        .parse()
       )
 
       r.errors[0].split('\n').forEach((line, i) => {
@@ -1277,14 +1277,14 @@ describe('usage tests', () => {
       const width = process.stdout.columns
 
       const r = checkUsage(() => yargs([])
-          .option('fairly-long-option', {
-            alias: 'f',
-            // create a giant string that should wrap.
-            description: new Array((width + 1) * 5).join('s')
-          })
-          .demand('foo')
-          .argv
-        )
+        .option('fairly-long-option', {
+          alias: 'f',
+          // create a giant string that should wrap.
+          description: new Array((width + 1) * 5).join('s')
+        })
+        .demand('foo')
+        .parse()
+      )
 
       // the long description should cause several line
       // breaks when wrapped.
@@ -1302,14 +1302,14 @@ describe('usage tests', () => {
 
     it('should wrap the left-hand-column if it takes up more than 50% of the screen', () => {
       const r = checkUsage(() => yargs([])
-          .example(
-            'i am a fairly long example',
-            'description that is also fairly long'
-          )
-          .demand('foo')
-          .wrap(40)
-          .argv
+        .example(
+          'i am a fairly long example',
+          'description that is also fairly long'
         )
+        .demand('foo')
+        .wrap(40)
+        .parse()
+      )
 
       // should split example usage onto multiple lines.
       r.errors[0].split('\n').length.should.equal(10)
@@ -1325,11 +1325,11 @@ describe('usage tests', () => {
 
     it('should not wrap left-hand-column if no description is provided', () => {
       const r = checkUsage(() => yargs([])
-          .example('i am a fairly long example that is like really long woooo')
-          .demand('foo')
-          .wrap(50)
-          .argv
-        )
+        .example('i am a fairly long example that is like really long woooo')
+        .demand('foo')
+        .wrap(50)
+        .parse()
+      )
 
       r.errors[0].split('\n').forEach((line, i) => {
         // ignore headings and blank lines.
@@ -1346,7 +1346,7 @@ describe('usage tests', () => {
         .usage('i am a fairly long usage string look at me go.')
         .demand('foo')
         .wrap(20)
-        .argv
+        .parse()
       )
 
       // the long usage string should cause line-breaks.
@@ -1357,16 +1357,16 @@ describe('usage tests', () => {
       const noColorAddedDescr = 'The file to add or remove'
 
       const r = checkUsage(() => yargs(['-h'])
-          .option('f', {
-            alias: 'file',
-            describe: noColorAddedDescr,
-            demand: true,
-            type: 'string'
-          })
-          .help('h').alias('h', 'help')
-          .wrap(80)
-          .argv
-        )
+        .option('f', {
+          alias: 'file',
+          describe: noColorAddedDescr,
+          demand: true,
+          type: 'string'
+        })
+        .help('h').alias('h', 'help')
+        .wrap(80)
+        .parse()
+      )
 
       r.logs.join('\n').split(/\n+/).should.deep.equal([
         'Options:',
@@ -1380,16 +1380,16 @@ describe('usage tests', () => {
       const yellowDescription = chalk.yellow('The file to add or remove')
 
       const r = checkUsage(() => yargs(['-h'])
-          .option('f', {
-            alias: 'file',
-            describe: yellowDescription,
-            demand: true,
-            type: 'string'
-          })
-          .help('h').alias('h', 'help')
-          .wrap(80)
-          .argv
-        )
+        .option('f', {
+          alias: 'file',
+          describe: yellowDescription,
+          demand: true,
+          type: 'string'
+        })
+        .help('h').alias('h', 'help')
+        .wrap(80)
+        .parse()
+      )
 
       r.logs.join('\n').split(/\n+/).should.deep.equal([
         'Options:',
@@ -1403,12 +1403,12 @@ describe('usage tests', () => {
   describe('commands', () => {
     it('should output a list of available commands', () => {
       const r = checkUsage(() => yargs('')
-          .command('upload', 'upload something')
-          .command('download', 'download something from somewhere')
-          .demand('y')
-          .wrap(null)
-          .argv
-        )
+        .command('upload', 'upload something')
+        .command('download', 'download something from somewhere')
+        .demand('y')
+        .wrap(null)
+        .parse()
+      )
 
       r.errors.join('\n').split(/\n+/).should.deep.equal([
         'usage [command]',
@@ -1425,12 +1425,12 @@ describe('usage tests', () => {
 
     it('should not show hidden commands', () => {
       const r = checkUsage(() => yargs('')
-          .command('upload', 'upload something')
-          .command('secret', false)
-          .demand('y')
-          .wrap(null)
-          .argv
-        )
+        .command('upload', 'upload something')
+        .command('secret', false)
+        .demand('y')
+        .wrap(null)
+        .parse()
+      )
 
       r.errors.join('\n').split(/\s+/).should.deep.equal([
         'usage',
@@ -1447,12 +1447,12 @@ describe('usage tests', () => {
 
     it('allows completion command to be hidden', () => {
       const r = checkUsage(() => yargs('')
-          .command('upload', 'upload something')
-          .completion('completion', false)
-          .demand('y')
-          .wrap(null)
-          .argv
-        )
+        .command('upload', 'upload something')
+        .completion('completion', false)
+        .demand('y')
+        .wrap(null)
+        .parse()
+      )
 
       r.errors.join('\n').split(/\s+/).should.deep.equal([
         'usage',
@@ -1479,15 +1479,15 @@ describe('usage tests', () => {
       const uploadHandler = (argv) => {}
 
       const generalHelp = checkUsage(() => yargs('--help')
-          .command(uploadCommand, uploadDesc, uploadOpts, uploadHandler)
-          .wrap(null)
-          .argv
-        )
+        .command(uploadCommand, uploadDesc, uploadOpts, uploadHandler)
+        .wrap(null)
+        .parse()
+      )
       const commandHelp = checkUsage(() => yargs('upload --help')
-          .command(uploadCommand, uploadDesc, uploadOpts, uploadHandler)
-          .wrap(null)
-          .argv
-        )
+        .command(uploadCommand, uploadDesc, uploadOpts, uploadHandler)
+        .wrap(null)
+        .parse()
+      )
 
       generalHelp.logs[0].split('\n').should.deep.equal([
         'usage [command]',
@@ -1515,23 +1515,23 @@ describe('usage tests', () => {
       const uploadCommand = 'upload <dest>'
       const uploadDesc = 'Upload cwd'
       const uploadBuilder = yargs => yargs
-          .option('force', {
-            describe: 'Force overwrite of remote directory contents',
-            type: 'boolean'
-          })
-          .wrap(46)
+        .option('force', {
+          describe: 'Force overwrite of remote directory contents',
+          type: 'boolean'
+        })
+        .wrap(46)
       const uploadHandler = argv => {}
 
       const generalHelp = checkUsage(() => yargs('--help')
-          .command(uploadCommand, uploadDesc, uploadBuilder, uploadHandler)
-          .wrap(null)
-          .argv
-        )
+        .command(uploadCommand, uploadDesc, uploadBuilder, uploadHandler)
+        .wrap(null)
+        .parse()
+      )
       const commandHelp = checkUsage(() => yargs('upload --help')
-          .command(uploadCommand, uploadDesc, uploadBuilder, uploadHandler)
-          .wrap(null)
-          .argv
-        )
+        .command(uploadCommand, uploadDesc, uploadBuilder, uploadHandler)
+        .wrap(null)
+        .parse()
+      )
 
       generalHelp.logs[0].split('\n').should.deep.equal([
         'usage [command]',
@@ -1558,17 +1558,17 @@ describe('usage tests', () => {
 
     it('resets groups for a command handler, respecting order', () => {
       const r = checkUsage(() => yargs(['upload', '-h'])
-          .command('upload', 'upload something', yargs => yargs
-              .option('q', {
-                type: 'boolean',
-                group: 'Flags:'
-              })
-              .help('h').group('h', 'Global Flags:')
-              .wrap(null))
-          .help('h').group('h', 'Global Flags:')
-          .wrap(null)
-          .argv
-        )
+        .command('upload', 'upload something', yargs => yargs
+          .option('q', {
+            type: 'boolean',
+            group: 'Flags:'
+          })
+          .help('h').group('h', 'Global Flags:')
+          .wrap(null))
+        .help('h').group('h', 'Global Flags:')
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'usage upload',
@@ -1588,26 +1588,26 @@ describe('usage tests', () => {
 
     it('allows global option to be disabled', () => {
       const r = checkUsage(() => yargs(['upload', '-h'])
-          .command('upload', 'upload something', yargs => yargs
-              .option('q', {
-                type: 'boolean',
-                group: 'Flags:'
-              })
-              .wrap(null))
-          .option('i', {
-            type: 'boolean',
-            global: true,
-            group: 'Awesome Flags:'
-          })
-          .option('j', {
+        .command('upload', 'upload something', yargs => yargs
+          .option('q', {
             type: 'boolean',
-            global: false, // not global so not preserved, even though the group is
-            group: 'Awesome Flags:'
+            group: 'Flags:'
           })
-          .help('h')
-          .wrap(null)
-          .argv
-        )
+          .wrap(null))
+        .option('i', {
+          type: 'boolean',
+          global: true,
+          group: 'Awesome Flags:'
+        })
+        .option('j', {
+          type: 'boolean',
+          global: false, // not global so not preserved, even though the group is
+          group: 'Awesome Flags:'
+        })
+        .help('h')
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'usage upload',
@@ -1628,21 +1628,21 @@ describe('usage tests', () => {
 
     it('can add to preserved groups', () => {
       const r = checkUsage(() => yargs(['upload', '-h'])
-          .command('upload', 'upload something', yargs => yargs
-              .option('q', {
-                type: 'boolean',
-                group: 'Awesome Flags:'
-              })
-              .wrap(null))
-          .option('i', {
+        .command('upload', 'upload something', yargs => yargs
+          .option('q', {
             type: 'boolean',
-            global: true,
             group: 'Awesome Flags:'
           })
-          .help('h')
-          .wrap(null)
-          .argv
-        )
+          .wrap(null))
+        .option('i', {
+          type: 'boolean',
+          global: true,
+          group: 'Awesome Flags:'
+        })
+        .help('h')
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'usage upload',
@@ -1661,27 +1661,27 @@ describe('usage tests', () => {
 
     it('can bump up preserved groups', () => {
       const r = checkUsage(() => yargs(['upload', '-h'])
-          .command('upload', 'upload something', yargs => yargs
-              .group([], 'Awesome Flags:')
-              .option('q', {
-                type: 'boolean',
-                group: 'Flags:'
-              })
-              .wrap(null))
-          .option('i', {
+        .command('upload', 'upload something', yargs => yargs
+          .group([], 'Awesome Flags:')
+          .option('q', {
             type: 'boolean',
-            global: true,
-            group: 'Awesome Flags:'
+            group: 'Flags:'
           })
-          .option('j', {
-            type: 'boolean',
-            global: false, // not global so not preserved, even though the group is
-            group: 'Awesome Flags:'
-          })
-          .help('h')
-          .wrap(null)
-          .argv
-        )
+          .wrap(null))
+        .option('i', {
+          type: 'boolean',
+          global: true,
+          group: 'Awesome Flags:'
+        })
+        .option('j', {
+          type: 'boolean',
+          global: false, // not global so not preserved, even though the group is
+          group: 'Awesome Flags:'
+        })
+        .help('h')
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'usage upload',
@@ -1702,15 +1702,15 @@ describe('usage tests', () => {
 
     it('should list a module command only once', () => {
       const r = checkUsage(() => yargs('--help')
-          .command('upload', 'upload something', {
-            builder (yargs) {
-              return yargs
-            },
-            handler (argv) {}
-          })
-          .wrap(null)
-          .argv
-        )
+        .command('upload', 'upload something', {
+          builder (yargs) {
+            return yargs
+          },
+          handler (argv) {}
+        })
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'usage [command]',
@@ -1726,15 +1726,15 @@ describe('usage tests', () => {
 
     it('allows a builder function to override default usage() string', () => {
       const r = checkUsage(() => yargs('upload --help')
-          .command('upload', 'upload something', {
-            builder (yargs) {
-              return yargs.usage('Usage: program upload <something> [opts]').demand(1)
-            },
-            handler (argv) {}
-          })
-          .wrap(null)
-          .argv
-        )
+        .command('upload', 'upload something', {
+          builder (yargs) {
+            return yargs.usage('Usage: program upload <something> [opts]').demand(1)
+          },
+          handler (argv) {}
+        })
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'Usage: program upload <something> [opts]',
@@ -1747,10 +1747,10 @@ describe('usage tests', () => {
 
     it('allows a builder function to disable default usage() with null', () => {
       const r = checkUsage(() => yargs('upload --help')
-          .command('upload', 'upload something', yargs => yargs.usage(null), (argv) => {})
-          .wrap(null)
-          .argv
-        )
+        .command('upload', 'upload something', yargs => yargs.usage(null), (argv) => {})
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'Options:',
@@ -1761,10 +1761,10 @@ describe('usage tests', () => {
 
     it('displays given command chain with positional args in default usage for subcommand with builder object', () => {
       const r = checkUsage(() => yargs('one two --help')
-          .command('one <sub>', 'level one, requires subcommand', yargs => yargs.command('two [next]', 'level two', {}, (argv) => {}), (argv) => {})
-          .wrap(null)
-          .argv
-        )
+        .command('one <sub>', 'level one, requires subcommand', yargs => yargs.command('two [next]', 'level two', {}, (argv) => {}), (argv) => {})
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'usage one two [next]',
@@ -1779,10 +1779,10 @@ describe('usage tests', () => {
 
     it('displays given command chain with positional args in default usage for subcommand with builder function', () => {
       const r = checkUsage(() => yargs('one two --help')
-          .command('one <sub>', 'level one, requires subcommand', yargs => yargs.command('two [next]', 'level two', yargs => yargs, (argv) => {}), (argv) => {})
-          .wrap(null)
-          .argv
-        )
+        .command('one <sub>', 'level one, requires subcommand', yargs => yargs.command('two [next]', 'level two', yargs => yargs, (argv) => {}), (argv) => {})
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'usage one two [next]',
@@ -1797,10 +1797,10 @@ describe('usage tests', () => {
 
     it('displays aliases for commands that have them (no wrap)', () => {
       const r = checkUsage(() => yargs('help')
-          .command(['copy <src> [dest]', 'cp', 'dupe'], 'Copy something')
-          .wrap(null)
-          .argv
-        )
+        .command(['copy <src> [dest]', 'cp', 'dupe'], 'Copy something')
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'usage [command]',
@@ -1816,10 +1816,10 @@ describe('usage tests', () => {
 
     it('displays aliases for commands that have them (with wrap)', () => {
       const r = checkUsage(() => yargs('help')
-          .command(['copy <src> [dest]', 'cp', 'dupe'], 'Copy something')
-          .wrap(80)
-          .argv
-        )
+        .command(['copy <src> [dest]', 'cp', 'dupe'], 'Copy something')
+        .wrap(80)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'usage [command]',
@@ -1837,7 +1837,7 @@ describe('usage tests', () => {
       const r = checkUsage(() => yargs('upload --help')
         .command('upload', 'upload something', yargs => yargs.usage('$0 upload [something]').usage('$0 upload [something else]'), (argv) => {})
         .wrap(null)
-        .argv
+        .parse()
       )
 
       r.logs[0].split('\n').should.deep.equal([
@@ -1854,7 +1854,7 @@ describe('usage tests', () => {
       const r = checkUsage(() => yargs('upload --help')
         .command('upload', 'upload something', yargs => yargs.usage('$0 upload [something]').usage('$0 upload [something else]').usage(null), (argv) => {})
         .wrap(null)
-        .argv
+        .parse()
       )
 
       r.logs[0].split('\n').should.deep.equal([
@@ -1871,7 +1871,7 @@ describe('usage tests', () => {
             .alias('h', 'help')
         })
         .wrap(null)
-        .argv
+        .parse()
       )
 
       r.logs[0].split('\n').should.deep.equal([
@@ -1889,11 +1889,11 @@ describe('usage tests', () => {
   describe('epilogue', () => {
     it('should display an epilog message at the end of the usage instructions', () => {
       const r = checkUsage(() => yargs('')
-          .epilog('for more info view the manual at http://example.com')
-          .demand('y')
-          .wrap(null)
-          .argv
-        )
+        .epilog('for more info view the manual at http://example.com')
+        .demand('y')
+        .wrap(null)
+        .parse()
+      )
 
       r.errors.join('\n').split(/\n+/).should.deep.equal([
         'Options:',
@@ -1907,11 +1907,11 @@ describe('usage tests', () => {
 
     it('replaces $0 in epilog string', () => {
       const r = checkUsage(() => yargs('')
-          .epilog("Try '$0 --long-help' for more information")
-          .demand('y')
-          .wrap(null)
-          .argv
-        )
+        .epilog("Try '$0 --long-help' for more information")
+        .demand('y')
+        .wrap(null)
+        .parse()
+      )
 
       r.errors.join('\n').split(/\n+/).should.deep.equal([
         'Options:',
@@ -1927,37 +1927,37 @@ describe('usage tests', () => {
   describe('default', () => {
     it('should indicate that the default is a generated-value, if function is provided', () => {
       const r = checkUsage(() => yargs(['-h'])
-          .help('h')
-          .default('f', () => 99)
-          .wrap(null)
-          .argv
-        )
+        .help('h')
+        .default('f', () => 99)
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].should.include('default: (generated-value)')
     })
 
     it('if a named function is provided, should use name rather than (generated-value)', () => {
       const r = checkUsage(() => yargs(['-h'])
-          .help('h')
-          .default('f', function randomNumber () {
-            return Math.random() * 256
-          })
-          .wrap(null)
-          .argv
-        )
+        .help('h')
+        .default('f', function randomNumber () {
+          return Math.random() * 256
+        })
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].should.include('default: (random-number)')
     })
 
     it('default-description take precedence if one is provided', () => {
       const r = checkUsage(() => yargs(['-h'])
-          .help('h')
-          .default('f', function randomNumber () {
-            return Math.random() * 256
-          }, 'foo-description')
-          .wrap(null)
-          .argv
-        )
+        .help('h')
+        .default('f', function randomNumber () {
+          return Math.random() * 256
+        }, 'foo-description')
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].should.include('default: foo-description')
     })
@@ -1969,7 +1969,7 @@ describe('usage tests', () => {
         .default('a2', [3])
         .default('o', {a: '33'})
         .wrap(null)
-        .argv
+        .parse()
       )
 
       r.logs[0].should.include('default: []')
@@ -1982,46 +1982,46 @@ describe('usage tests', () => {
     describe('using option() without default()', () => {
       it('should output given desc with default value', () => {
         const r = checkUsage(() => yargs(['-h'])
-            .help('h')
-            .option('port', {
-              describe: 'The port value for URL',
-              defaultDescription: '80 for HTTP and 443 for HTTPS',
-              default: 80
-            })
-            .wrap(null)
-            .argv
-          )
+          .help('h')
+          .option('port', {
+            describe: 'The port value for URL',
+            defaultDescription: '80 for HTTP and 443 for HTTPS',
+            default: 80
+          })
+          .wrap(null)
+          .parse()
+        )
 
         r.logs[0].should.include('default: 80 for HTTP and 443 for HTTPS')
       })
 
       it('should output given desc without default value', () => {
         const r = checkUsage(() => yargs(['-h'])
-            .help('h')
-            .option('port', {
-              describe: 'The port value for URL',
-              defaultDescription: '80 for HTTP and 443 for HTTPS'
-            })
-            .wrap(null)
-            .argv
-          )
+          .help('h')
+          .option('port', {
+            describe: 'The port value for URL',
+            defaultDescription: '80 for HTTP and 443 for HTTPS'
+          })
+          .wrap(null)
+          .parse()
+        )
 
         r.logs[0].should.include('default: 80 for HTTP and 443 for HTTPS')
       })
 
       it('should prefer given desc over function desc', () => {
         const r = checkUsage(() => yargs(['-h'])
-            .help('h')
-            .option('port', {
-              describe: 'The port value for URL',
-              defaultDescription: '80 for HTTP and 443 for HTTPS',
-              default: function determinePort () {
-                return 80
-              }
-            })
-            .wrap(null)
-            .argv
-          )
+          .help('h')
+          .option('port', {
+            describe: 'The port value for URL',
+            defaultDescription: '80 for HTTP and 443 for HTTPS',
+            default: function determinePort () {
+              return 80
+            }
+          })
+          .wrap(null)
+          .parse()
+        )
 
         r.logs[0].should.include('default: 80 for HTTP and 443 for HTTPS')
       })
@@ -2030,47 +2030,47 @@ describe('usage tests', () => {
     describe('using option() with default()', () => {
       it('should prefer default() desc when given last', () => {
         const r = checkUsage(() => yargs(['-h'])
-            .help('h')
-            .option('port', {
-              describe: 'The port value for URL',
-              defaultDescription: 'depends on protocol'
-            })
-            .default('port', null, '80 for HTTP and 443 for HTTPS')
-            .wrap(null)
-            .argv
-          )
+          .help('h')
+          .option('port', {
+            describe: 'The port value for URL',
+            defaultDescription: 'depends on protocol'
+          })
+          .default('port', null, '80 for HTTP and 443 for HTTPS')
+          .wrap(null)
+          .parse()
+        )
 
         r.logs[0].should.include('default: 80 for HTTP and 443 for HTTPS')
       })
 
       it('should prefer option() desc when given last', () => {
         const r = checkUsage(() => yargs(['-h'])
-            .help('h')
-            .default('port', null, '80 for HTTP and 443 for HTTPS')
-            .option('port', {
-              describe: 'The port value for URL',
-              defaultDescription: 'depends on protocol'
-            })
-            .wrap(null)
-            .argv
-          )
+          .help('h')
+          .default('port', null, '80 for HTTP and 443 for HTTPS')
+          .option('port', {
+            describe: 'The port value for URL',
+            defaultDescription: 'depends on protocol'
+          })
+          .wrap(null)
+          .parse()
+        )
 
         r.logs[0].should.include('default: depends on protocol')
       })
 
       it('should prefer option() desc over default() function', () => {
         const r = checkUsage(() => yargs(['-h'])
-            .help('h')
-            .option('port', {
-              describe: 'The port value for URL',
-              defaultDescription: '80 for HTTP and 443 for HTTPS'
-            })
-            .default('port', function determinePort () {
-              return 80
-            })
-            .wrap(null)
-            .argv
-          )
+          .help('h')
+          .option('port', {
+            describe: 'The port value for URL',
+            defaultDescription: '80 for HTTP and 443 for HTTPS'
+          })
+          .default('port', function determinePort () {
+            return 80
+          })
+          .wrap(null)
+          .parse()
+        )
 
         r.logs[0].should.include('default: 80 for HTTP and 443 for HTTPS')
       })
@@ -2081,12 +2081,12 @@ describe('usage tests', () => {
     // see #128
     it("should display 'description' string in help message if set for alias", () => {
       const r = checkUsage(() => yargs(['-h'])
-          .describe('foo', 'foo option')
-          .alias('f', 'foo')
-          .help('h')
-          .wrap(null)
-          .argv
-        )
+        .describe('foo', 'foo option')
+        .alias('f', 'foo')
+        .help('h')
+        .wrap(null)
+        .parse()
+      )
 
       r.logs.join('\n').split(/\n+/).should.deep.equal([
         'Options:',
@@ -2098,12 +2098,12 @@ describe('usage tests', () => {
 
     it("should display 'required' string in help message if set for alias", () => {
       const r = checkUsage(() => yargs(['-h'])
-          .demand('foo')
-          .alias('f', 'foo')
-          .help('h')
-          .wrap(null)
-          .argv
-        )
+        .demand('foo')
+        .alias('f', 'foo')
+        .help('h')
+        .wrap(null)
+        .parse()
+      )
 
       r.logs.join('\n').split(/\n+/).should.deep.equal([
         'Options:',
@@ -2115,13 +2115,13 @@ describe('usage tests', () => {
 
     it("should display 'type' string in help message if set for alias", () => {
       const r = checkUsage(() => yargs(['-h'])
-          .string('foo')
-          .describe('foo', 'bar')
-          .alias('f', 'foo')
-          .help('h')
-          .wrap(null)
-          .argv
-        )
+        .string('foo')
+        .describe('foo', 'bar')
+        .alias('f', 'foo')
+        .help('h')
+        .wrap(null)
+        .parse()
+      )
 
       r.logs.join('\n').split(/\n+/).should.deep.equal([
         'Options:',
@@ -2133,14 +2133,14 @@ describe('usage tests', () => {
 
     it("should display 'type' number in help message if set for alias", () => {
       const r = checkUsage(() => yargs(['-h'])
-          .string('foo')
-          .describe('foo', 'bar')
-          .alias('f', 'foo')
-          .number(['foo'])
-          .help('h')
-          .wrap(null)
-          .argv
-        )
+        .string('foo')
+        .describe('foo', 'bar')
+        .alias('f', 'foo')
+        .number(['foo'])
+        .help('h')
+        .wrap(null)
+        .parse()
+      )
 
       r.logs.join('\n').split(/\n+/).should.deep.equal([
         'Options:',
@@ -2315,17 +2315,17 @@ describe('usage tests', () => {
   describe('choices', () => {
     it('should output choices when defined for non-hidden options', () => {
       const r = checkUsage(() => yargs(['--help'])
-          .option('answer', {
-            describe: 'does this look good?',
-            choices: ['yes', 'no', 'maybe']
-          })
-          .option('confidence', {
-            describe: 'percentage of confidence',
-            choices: [0, 25, 50, 75, 100]
-          })
-          .wrap(null)
-          .argv
-        )
+        .option('answer', {
+          describe: 'does this look good?',
+          choices: ['yes', 'no', 'maybe']
+        })
+        .option('confidence', {
+          describe: 'percentage of confidence',
+          choices: [0, 25, 50, 75, 100]
+        })
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'Options:',
@@ -2338,18 +2338,18 @@ describe('usage tests', () => {
 
     it('should not output choices when defined for hidden options', () => {
       const r = checkUsage(() => yargs(['--help'])
-          .option('answer', {
-            type: 'string',
-            choices: ['yes', 'no', 'maybe'],
-            hidden: true
-          })
-          .option('confidence', {
-            choices: [0, 25, 50, 75, 100],
-            hidden: true
-          })
-          .wrap(null)
-          .argv
-        )
+        .option('answer', {
+          type: 'string',
+          choices: ['yes', 'no', 'maybe'],
+          hidden: true
+        })
+        .option('confidence', {
+          choices: [0, 25, 50, 75, 100],
+          hidden: true
+        })
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'Options:',
@@ -2362,14 +2362,14 @@ describe('usage tests', () => {
   describe('count', () => {
     it('should indicate when an option is a count', () => {
       const r = checkUsage(() => yargs(['--help'])
-          .option('verbose', {
-            describe: 'verbose level',
-            count: true
-          })
-          .help('help')
-          .wrap(null)
-          .argv
-        )
+        .option('verbose', {
+          describe: 'verbose level',
+          count: true
+        })
+        .help('help')
+        .wrap(null)
+        .parse()
+      )
 
       r.logs.join(' ').should.match(/\[count]/)
     })
@@ -2378,14 +2378,14 @@ describe('usage tests', () => {
   describe('array', () => {
     it('should indicate when an option is an array', () => {
       const r = checkUsage(() => yargs(['--help'])
-          .option('arr', {
-            describe: 'array option',
-            array: true
-          })
-          .help('help')
-          .wrap(null)
-          .argv
-        )
+        .option('arr', {
+          describe: 'array option',
+          array: true
+        })
+        .help('help')
+        .wrap(null)
+        .parse()
+      )
 
       r.logs.join(' ').should.match(/\[array]/)
     })
@@ -2394,15 +2394,15 @@ describe('usage tests', () => {
   describe('group', () => {
     it('allows an an option to be placed in an alternative group', () => {
       const r = checkUsage(() => yargs(['--help'])
-          .option('batman', {
-            type: 'string',
-            describe: "not the world's happiest guy",
-            default: 'Bruce Wayne'
-          })
-          .group('batman', 'Heroes:')
-          .wrap(null)
-          .argv
-        )
+        .option('batman', {
+          type: 'string',
+          describe: "not the world's happiest guy",
+          default: 'Bruce Wayne'
+        })
+        .group('batman', 'Heroes:')
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'Heroes:',
@@ -2416,15 +2416,15 @@ describe('usage tests', () => {
 
     it("does not print the 'Options:' group if no keys are in it", () => {
       const r = checkUsage(() => yargs(['-h'])
-          .string('batman')
-          .describe('batman', "not the world's happiest guy")
-          .default('batman', 'Bruce Wayne')
-          .group('batman', 'Heroes:')
-          .group('h', 'Heroes:')
-          .help('h')
-          .wrap(null)
-          .argv
-        )
+        .string('batman')
+        .describe('batman', "not the world's happiest guy")
+        .default('batman', 'Bruce Wayne')
+        .group('batman', 'Heroes:')
+        .group('h', 'Heroes:')
+        .help('h')
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'Heroes:',
@@ -2438,12 +2438,12 @@ describe('usage tests', () => {
 
     it('displays alias keys appropriately within a grouping', () => {
       const r = checkUsage(() => yargs(['-h'])
-          .alias('h', 'help')
-          .group('help', 'Magic Variable:')
-          .group('version', 'Magic Variable:')
-          .wrap(null)
-          .argv
-        )
+        .alias('h', 'help')
+        .group('help', 'Magic Variable:')
+        .group('version', 'Magic Variable:')
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'Magic Variable:',
@@ -2454,10 +2454,10 @@ describe('usage tests', () => {
 
     it('allows a group to be provided as the only information about an option', () => {
       const r = checkUsage(() => yargs(['--help'])
-          .group('batman', 'Heroes:')
-          .wrap(null)
-          .argv
-        )
+        .group('batman', 'Heroes:')
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'Heroes:',
@@ -2471,12 +2471,12 @@ describe('usage tests', () => {
 
     it('allows multiple options to be grouped at the same time', () => {
       const r = checkUsage(() => yargs(['-h'])
-          .help('h')
-          .group('h', 'Options:')
-          .group(['batman', 'robin'], 'Heroes:')
-          .wrap(null)
-          .argv
-        )
+        .help('h')
+        .group('h', 'Options:')
+        .group(['batman', 'robin'], 'Heroes:')
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'Options:',
@@ -2491,14 +2491,14 @@ describe('usage tests', () => {
 
     it('allows group to be provided in the options object', () => {
       const r = checkUsage(() => yargs(['-h'])
-          .help('h')
-          .option('batman', {
-            group: 'Heroes:',
-            string: true
-          })
-          .wrap(null)
-          .argv
-        )
+        .help('h')
+        .option('batman', {
+          group: 'Heroes:',
+          string: true
+        })
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'Heroes:',
@@ -2512,14 +2512,14 @@ describe('usage tests', () => {
 
     it('only displays a duplicated option once per group', () => {
       const r = checkUsage(() => yargs(['--help'])
-          .group(['batman', 'batman'], 'Heroes:')
-          .group('robin', 'Heroes:')
-          .option('robin', {
-            group: 'Heroes:'
-          })
-          .wrap(null)
-          .argv
-        )
+        .group(['batman', 'batman'], 'Heroes:')
+        .group('robin', 'Heroes:')
+        .option('robin', {
+          group: 'Heroes:'
+        })
+        .wrap(null)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'Heroes:',
@@ -2556,11 +2556,11 @@ describe('usage tests', () => {
   describe('default command', () => {
     it('should display top-level help with no command given', () => {
       const r = checkUsage(() => yargs('--help')
-          .command(['list [pattern]', 'ls', '*'], 'List key-value pairs for pattern', {}, noop)
-          .command('get <key>', 'Get value for key', {}, noop)
-          .command('set <key> [value]', 'Set value for key', {}, noop)
-          .argv
-        )
+        .command(['list [pattern]', 'ls', '*'], 'List key-value pairs for pattern', {}, noop)
+        .command('get <key>', 'Get value for key', {}, noop)
+        .command('set <key> [value]', 'Set value for key', {}, noop)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'usage [pattern]',
@@ -2581,11 +2581,11 @@ describe('usage tests', () => {
 
     it('should display default command as ./$0 if it has no aliases', () => {
       const r = checkUsage(() => yargs('--help')
-          .command('* [pattern]', 'List key-value pairs for pattern', {}, noop)
-          .command('get <key>', 'Get value for key', {}, noop)
-          .command('set <key> [value]', 'Set value for key', {}, noop)
-          .argv
-        )
+        .command('* [pattern]', 'List key-value pairs for pattern', {}, noop)
+        .command('get <key>', 'Get value for key', {}, noop)
+        .command('set <key> [value]', 'Set value for key', {}, noop)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'usage [pattern]',
@@ -2605,16 +2605,16 @@ describe('usage tests', () => {
 
     it('should display positionals that have been configured', () => {
       const r = checkUsage(() => yargs('--help')
-          .command('* [pattern]', 'List key-value pairs for pattern', (yargs) => {
-            yargs.positional('pattern', {
-              type: 'string',
-              default: '.*'
-            })
-          }, noop)
-          .command('get <key>', 'Get value for key', {}, noop)
-          .command('set <key> [value]', 'Set value for key', {}, noop)
-          .argv
-        )
+        .command('* [pattern]', 'List key-value pairs for pattern', (yargs) => {
+          yargs.positional('pattern', {
+            type: 'string',
+            default: '.*'
+          })
+        }, noop)
+        .command('get <key>', 'Get value for key', {}, noop)
+        .command('set <key> [value]', 'Set value for key', {}, noop)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'usage [pattern]',
@@ -2637,11 +2637,11 @@ describe('usage tests', () => {
 
     it('should display options that have been configured', () => {
       const r = checkUsage(() => yargs('--help')
-          .command('* [pattern]', 'List key-value pairs for pattern', {uuid: {required: true}}, noop)
-          .command('get <key>', 'Get value for key', {}, noop)
-          .command('set <key> [value]', 'Set value for key', {}, noop)
-          .argv
-        )
+        .command('* [pattern]', 'List key-value pairs for pattern', {uuid: {required: true}}, noop)
+        .command('get <key>', 'Get value for key', {}, noop)
+        .command('set <key> [value]', 'Set value for key', {}, noop)
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'usage [pattern]',
@@ -2669,7 +2669,7 @@ describe('usage tests', () => {
             describe: 'the pattern to list keys for'
           })
         })
-        .argv
+        .parse()
       )
 
       r.logs[0].split('\n').should.deep.equal([
@@ -2693,7 +2693,7 @@ describe('usage tests', () => {
             describe: 'the pattern to list keys for'
           })
         })
-        .argv
+        .parse()
       )
 
       r.logs[0].split('\n').should.deep.equal([
@@ -2717,7 +2717,7 @@ describe('usage tests', () => {
             describe: 'the pattern to list keys for'
           })
         })
-        .argv
+        .parse()
       )
 
       r.logs[0].split('\n').should.deep.equal([
@@ -2741,7 +2741,7 @@ describe('usage tests', () => {
             describe: 'the pattern to list keys for'
           })
         })
-        .argv
+        .parse()
       )
 
       r.logs[0].split('\n').should.deep.equal([
@@ -2766,7 +2766,7 @@ describe('usage tests', () => {
             type: 'string'
           })
         })
-        .argv
+        .parse()
       )
 
       r.logs[0].split('\n').should.deep.equal([
@@ -2791,7 +2791,7 @@ describe('usage tests', () => {
             choices: ['foo', 'bar']
           })
         })
-        .argv
+        .parse()
       )
 
       r.logs[0].split('\n').should.deep.equal([
@@ -2812,18 +2812,18 @@ describe('usage tests', () => {
   describe('hidden options', () => {
     it('--help should display all options except for hidden ones', () => {
       const r = checkUsage(() => yargs('--help')
-          .options({
-            foo: {
-              describe: 'FOO'
-            },
-            bar: {},
-            baz: {
-              describe: 'BAZ',
-              hidden: true
-            }
-          })
-          .argv
-        )
+        .options({
+          foo: {
+            describe: 'FOO'
+          },
+          bar: {},
+          baz: {
+            describe: 'BAZ',
+            hidden: true
+          }
+        })
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'Options:',
@@ -2835,18 +2835,18 @@ describe('usage tests', () => {
     })
     it('--help should display all options (including hidden ones) with --show-hidden', () => {
       const r = checkUsage(() => yargs('--help --show-hidden --mama ama')
-          .options({
-            foo: {
-              describe: 'FOO'
-            },
-            bar: {},
-            baz: {
-              describe: 'BAZ',
-              hidden: true
-            }
-          })
-          .argv
-        )
+        .options({
+          foo: {
+            describe: 'FOO'
+          },
+          bar: {},
+          baz: {
+            describe: 'BAZ',
+            hidden: true
+          }
+        })
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'Options:',
@@ -2859,19 +2859,19 @@ describe('usage tests', () => {
     })
     it('--help should display --custom-show-hidden', () => {
       const r = checkUsage(() => yargs('--help')
-          .options({
-            foo: {
-              describe: 'FOO'
-            },
-            bar: {},
-            baz: {
-              describe: 'BAZ',
-              hidden: true
-            }
-          })
-          .showHidden('custom-show-hidden')
-          .argv
-        )
+        .options({
+          foo: {
+            describe: 'FOO'
+          },
+          bar: {},
+          baz: {
+            describe: 'BAZ',
+            hidden: true
+          }
+        })
+        .showHidden('custom-show-hidden')
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'Options:',
@@ -2884,19 +2884,19 @@ describe('usage tests', () => {
     })
     it('--help should display all options with --custom-show-hidden', () => {
       const r = checkUsage(() => yargs('--help --custom-show-hidden')
-          .options({
-            foo: {
-              describe: 'FOO'
-            },
-            bar: {},
-            baz: {
-              describe: 'BAZ',
-              hidden: true
-            }
-          })
-          .showHidden('custom-show-hidden')
-          .argv
-        )
+        .options({
+          foo: {
+            describe: 'FOO'
+          },
+          bar: {},
+          baz: {
+            describe: 'BAZ',
+            hidden: true
+          }
+        })
+        .showHidden('custom-show-hidden')
+        .parse()
+      )
 
       r.logs[0].split('\n').should.deep.equal([
         'Options:',
diff --git a/test/validation.js b/test/validation.js
index cc8eb18..c9d0593 100644
--- a/test/validation.js
+++ b/test/validation.js
@@ -22,7 +22,7 @@ describe('validation tests', () => {
           msg.should.match(/Implications failed/)
           return done()
         })
-        .argv
+        .parse()
     })
 
     it("fails if key implies values in '_', but '_' is not populated", (done) => {
@@ -35,25 +35,25 @@ describe('validation tests', () => {
           msg.should.match(/Implications failed/)
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('fails if either implied argument is not set and displays only failed', (done) => {
       yargs(['-f', '-b'])
-          .implies('f', ['b', 'c'])
-          .fail((msg1) => {
-            yargs(['-f', '-c'])
-                .implies('f', ['b', 'c'])
-                .fail((msg2) => {
-                  msg1.should.match(/f -> c/)
-                  msg1.should.not.match(/f -> b/)
-                  msg2.should.match(/f -> b/)
-                  msg2.should.not.match(/f -> c/)
-                  return done()
-                })
-                .argv
-          })
-          .argv
+        .implies('f', ['b', 'c'])
+        .fail((msg1) => {
+          yargs(['-f', '-c'])
+            .implies('f', ['b', 'c'])
+            .fail((msg2) => {
+              msg1.should.match(/f -> c/)
+              msg1.should.not.match(/f -> b/)
+              msg2.should.match(/f -> b/)
+              msg2.should.not.match(/f -> c/)
+              return done()
+            })
+            .parse()
+        })
+        .parse()
     })
 
     it("fails if --no-foo's implied argument is not set", (done) => {
@@ -65,7 +65,7 @@ describe('validation tests', () => {
           msg.should.match(/Implications failed/)
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('fails if a key is set, along with a key that it implies should not be set', (done) => {
@@ -77,7 +77,7 @@ describe('validation tests', () => {
           msg.should.match(/Implications failed/)
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('fails if implied key (with "no" in the name) is not set', () => {
@@ -85,14 +85,14 @@ describe('validation tests', () => {
       yargs('--bar')
         .implies({
           'bar': 'noFoo' // --bar means --noFoo (or --no-foo with boolean-negation disabled) is required
-                         // note that this has nothing to do with --foo
+          // note that this has nothing to do with --foo
         })
         .fail((msg) => {
           failCalled = true
           msg.should.match(/Implications failed/)
         })
-        .argv
-      failCalled.should.be.true
+        .parse()
+      failCalled.should.equal(true)
     })
 
     it('doesn\'t fail if implied key (with "no" in the name) is set', () => {
@@ -100,16 +100,16 @@ describe('validation tests', () => {
       const argv = yargs('--bar --noFoo')
         .implies({
           'bar': 'noFoo' // --bar means --noFoo (or --no-foo with boolean-negation disabled) is required
-                         // note that this has nothing to do with --foo
+          // note that this has nothing to do with --foo
         })
         .fail((msg) => {
           failCalled = true
         })
-        .argv
-      failCalled.should.be.false
-      expect(argv.bar).to.be.true
-      expect(argv.noFoo).to.be.true
-      expect(argv.foo).to.not.exist
+        .parse()
+      failCalled.should.equal(false)
+      expect(argv.bar).to.equal(true)
+      expect(argv.noFoo).to.equal(true)
+      expect(argv.foo).to.equal(undefined)
     })
 
     it('fails if implied key (with "no" in the name) is given when it should not', () => {
@@ -117,14 +117,14 @@ describe('validation tests', () => {
       yargs('--bar --noFoo')
         .implies({
           'bar': '--no-noFoo' // --bar means --noFoo (or --no-foo with boolean-negation disabled) cannot be given
-                              // note that this has nothing to do with --foo
+          // note that this has nothing to do with --foo
         })
         .fail((msg) => {
           failCalled = true
           msg.should.match(/Implications failed/)
         })
-        .argv
-      failCalled.should.be.true
+        .parse()
+      failCalled.should.equal(true)
     })
 
     it('doesn\'t fail if implied key (with "no" in the name) that should not be given is not set', () => {
@@ -132,16 +132,16 @@ describe('validation tests', () => {
       const argv = yargs('--bar')
         .implies({
           'bar': '--no-noFoo' // --bar means --noFoo (or --no-foo with boolean-negation disabled) cannot be given
-                              // note that this has nothing to do with --foo
+          // note that this has nothing to do with --foo
         })
         .fail((msg) => {
           failCalled = true
         })
-        .argv
-      failCalled.should.be.false
-      expect(argv.bar).to.be.true
-      expect(argv.noFoo).to.not.exist
-      expect(argv.foo).to.not.exist
+        .parse()
+      failCalled.should.equal(false)
+      expect(argv.bar).to.equal(true)
+      expect(argv.noFoo).to.equal(undefined)
+      expect(argv.foo).to.equal(undefined)
     })
 
     it('allows key to be specified with option shorthand', (done) => {
@@ -153,35 +153,35 @@ describe('validation tests', () => {
           msg.should.match(/Implications failed/)
           return done()
         })
-        .argv
+        .parse()
     })
   })
 
   describe('conflicts', () => {
     it('fails if both arguments are supplied', (done) => {
       yargs(['-f', '-b'])
-          .conflicts('f', 'b')
-          .fail((msg) => {
-            msg.should.equal('Arguments f and b are mutually exclusive')
-            return done()
-          })
-          .argv
+        .conflicts('f', 'b')
+        .fail((msg) => {
+          msg.should.equal('Arguments f and b are mutually exclusive')
+          return done()
+        })
+        .parse()
     })
 
     it('fails if argument is supplied along with either conflicting argument', (done) => {
       yargs(['-f', '-b'])
-          .conflicts('f', ['b', 'c'])
-          .fail((msg1) => {
-            yargs(['-f', '-c'])
-                .conflicts('f', ['b', 'c'])
-                .fail((msg2) => {
-                  msg1.should.equal('Arguments f and b are mutually exclusive')
-                  msg2.should.equal('Arguments f and c are mutually exclusive')
-                  return done()
-                })
-                .argv
-          })
-          .argv
+        .conflicts('f', ['b', 'c'])
+        .fail((msg1) => {
+          yargs(['-f', '-c'])
+            .conflicts('f', ['b', 'c'])
+            .fail((msg2) => {
+              msg1.should.equal('Arguments f and b are mutually exclusive')
+              msg2.should.equal('Arguments f and c are mutually exclusive')
+              return done()
+            })
+            .parse()
+        })
+        .parse()
     })
 
     it('should not fail if no conflicting arguments are provided', () => {
@@ -190,7 +190,7 @@ describe('validation tests', () => {
         .fail((msg) => {
           expect.fail()
         })
-        .argv
+        .parse()
     })
 
     it('should not fail if argument with conflict is provided, but not the argument it conflicts with', () => {
@@ -206,23 +206,23 @@ describe('validation tests', () => {
         .fail((msg) => {
           expect.fail()
         })
-        .argv
+        .parse()
     })
 
     it('should not fail if conflicting argument is provided, without argument with conflict', () => {
       yargs(['command', '-b', '-c'])
-          .command('command')
-          .option('f', {
-            describe: 'a foo'
-          })
-          .option('b', {
-            describe: 'a bar'
-          })
-          .conflicts('f', 'b')
-          .fail((msg) => {
-            expect.fail()
-          })
-          .argv
+        .command('command')
+        .option('f', {
+          describe: 'a foo'
+        })
+        .option('b', {
+          describe: 'a bar'
+        })
+        .conflicts('f', 'b')
+        .fail((msg) => {
+          expect.fail()
+        })
+        .parse()
     })
 
     it('allows an object to be provided defining conflicting option pairs', (done) => {
@@ -235,7 +235,7 @@ describe('validation tests', () => {
           msg.should.equal('Arguments s and t are mutually exclusive')
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('takes into account aliases when applying conflicts logic', (done) => {
@@ -249,19 +249,19 @@ describe('validation tests', () => {
           msg.should.equal('Arguments s and t are mutually exclusive')
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('allows key to be specified with option shorthand', (done) => {
       yargs(['-f', '-b'])
-          .option('f', {
-            conflicts: 'b'
-          })
-          .fail((msg) => {
-            msg.should.equal('Arguments f and b are mutually exclusive')
-            return done()
-          })
-          .argv
+        .option('f', {
+          conflicts: 'b'
+        })
+        .fail((msg) => {
+          msg.should.equal('Arguments f and b are mutually exclusive')
+          return done()
+        })
+        .parse()
     })
 
     it('should fail if alias of conflicting argument is provided', (done) => {
@@ -272,7 +272,7 @@ describe('validation tests', () => {
           msg.should.equal('Arguments f and b are mutually exclusive')
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('should fail if alias of argument with conflict is provided', (done) => {
@@ -283,7 +283,7 @@ describe('validation tests', () => {
           msg.should.equal('Arguments f and b are mutually exclusive')
           return done()
         })
-        .argv
+        .parse()
     })
   })
 
@@ -295,7 +295,7 @@ describe('validation tests', () => {
           msg.should.equal('Not enough non-option arguments: got 0, need at least 1')
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('fails in strict mode with invalid command', (done) => {
@@ -308,7 +308,7 @@ describe('validation tests', () => {
           msg.should.equal('Unknown argument: koala')
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('does not fail in strict mode when no commands configured', () => {
@@ -318,7 +318,7 @@ describe('validation tests', () => {
         .fail((msg) => {
           expect.fail()
         })
-        .argv
+        .parse()
       argv._[0].should.equal('koala')
     })
 
@@ -366,7 +366,7 @@ describe('validation tests', () => {
           msg.should.equal('Missing required argument: b')
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('fails when required arguments are present, but a command is missing', (done) => {
@@ -376,7 +376,7 @@ describe('validation tests', () => {
           msg.should.equal('Not enough non-option arguments: got 0, need at least 1')
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('fails without a message if msg is null', (done) => {
@@ -386,7 +386,7 @@ describe('validation tests', () => {
           expect(msg).to.equal(null)
           return done()
         })
-        .argv
+        .parse()
     })
 
     // address regression in: https://github.com/yargs/yargs/pull/740
@@ -397,7 +397,7 @@ describe('validation tests', () => {
           expect(msg).to.equal('hey! give me a custom exit message')
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('interprets min relative to command', () => {
@@ -408,7 +408,7 @@ describe('validation tests', () => {
             failureMsg = msg
           })
         })
-        .argv
+        .parse()
       expect(failureMsg).to.equal('Not enough non-option arguments: got 0, need at least 1')
     })
 
@@ -420,7 +420,7 @@ describe('validation tests', () => {
             failureMsg = msg
           })
         })
-        .argv
+        .parse()
       expect(failureMsg).to.equal('Too many non-option arguments: got 2, maximum of 1')
     })
   })
@@ -430,7 +430,7 @@ describe('validation tests', () => {
       yargs()
         .option('w', {type: 'number', requiresArg: true})
         .parse('-w', (err, argv, output) => {
-          expect(err).to.exist
+          expect(err).to.not.equal(undefined)
           expect(err).to.have.property('message', 'Not enough arguments following: w')
           return done()
         })
@@ -440,7 +440,7 @@ describe('validation tests', () => {
       yargs()
         .option('w', {type: 'string', requiresArg: true})
         .parse('-w', (err, argv, output) => {
-          expect(err).to.exist
+          expect(err).to.not.equal(undefined)
           expect(err).to.have.property('message', 'Not enough arguments following: w')
           return done()
         })
@@ -450,7 +450,7 @@ describe('validation tests', () => {
       yargs()
         .option('w', {type: 'boolean', requiresArg: true})
         .parse('-w', (err, argv, output) => {
-          expect(err).to.exist
+          expect(err).to.not.equal(undefined)
           expect(err).to.have.property('message', 'Not enough arguments following: w')
           return done()
         })
@@ -460,7 +460,7 @@ describe('validation tests', () => {
       yargs()
         .option('w', {type: 'array', requiresArg: true})
         .parse('-w', (err, argv, output) => {
-          expect(err).to.exist
+          expect(err).to.not.equal(undefined)
           expect(err).to.have.property('message', 'Not enough arguments following: w')
           return done()
         })
@@ -499,7 +499,7 @@ describe('validation tests', () => {
           ])
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('fails with one valid and one invalid value', (done) => {
@@ -512,7 +512,7 @@ describe('validation tests', () => {
           ])
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('fails with multiple invalid values for same argument', (done) => {
@@ -525,7 +525,7 @@ describe('validation tests', () => {
           ])
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('fails with case-insensitive value', (done) => {
@@ -538,7 +538,7 @@ describe('validation tests', () => {
           ])
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('fails with multiple invalid arguments', (done) => {
@@ -553,7 +553,7 @@ describe('validation tests', () => {
           ])
           return done()
         })
-        .argv
+        .parse()
     })
 
     // addresses: https://github.com/yargs/yargs/issues/849
@@ -575,7 +575,7 @@ describe('validation tests', () => {
         .fail((msg) => {
           expect.fail()
         })
-        .argv
+        .parse()
     })
 
     // addresses: https://github.com/yargs/yargs/issues/849
@@ -596,7 +596,7 @@ describe('validation tests', () => {
           msg.should.equal('Missing required argument: c')
           return done()
         })
-        .argv
+        .parse()
     })
 
     // addresses: https://github.com/yargs/yargs/issues/849
@@ -616,7 +616,7 @@ describe('validation tests', () => {
         .fail((msg) => {
           expect.fail()
         })
-        .argv
+        .parse()
     })
 
     // addresses: https://github.com/yargs/yargs/issues/849
@@ -635,7 +635,7 @@ describe('validation tests', () => {
         .fail((msg) => {
           expect.fail()
         })
-        .argv
+        .parse()
     })
   })
 
@@ -648,7 +648,7 @@ describe('validation tests', () => {
           msg.should.eql('Invalid JSON config file: fake.json')
           return done()
         })
-        .argv
+        .parse()
     })
 
     // see: https://github.com/yargs/yargs/issues/172
@@ -662,19 +662,19 @@ describe('validation tests', () => {
         .fail(() => {
           fail = true
         })
-        .argv
+        .parse()
 
       fail.should.equal(false)
     })
 
     it('should be displayed in the help message', () => {
       const r = checkUsage(() => yargs(['--help'])
-          .config('settings')
-          .help('help')
-          .version(false)
-          .wrap(null)
-          .argv
-        )
+        .config('settings')
+        .help('help')
+        .version(false)
+        .wrap(null)
+        .parse()
+      )
       r.should.have.property('logs').with.length(1)
       r.logs.join('\n').split(/\n+/).should.deep.equal([
         'Options:',
@@ -686,12 +686,12 @@ describe('validation tests', () => {
     it('should be displayed in the help message with its default name', () => {
       const checkUsage = require('./helpers/utils').checkOutput
       const r = checkUsage(() => yargs(['--help'])
-            .config()
-            .help('help')
-            .version(false)
-            .wrap(null)
-            .argv
-          )
+        .config()
+        .help('help')
+        .version(false)
+        .wrap(null)
+        .parse()
+      )
       r.should.have.property('logs').with.length(1)
       r.logs.join('\n').split(/\n+/).should.deep.equal([
         'Options:',
@@ -703,12 +703,12 @@ describe('validation tests', () => {
     it('should allow help message to be overridden', () => {
       const checkUsage = require('./helpers/utils').checkOutput
       const r = checkUsage(() => yargs(['--help'])
-          .config('settings', 'pork chop sandwiches')
-          .help('help')
-          .version(false)
-          .wrap(null)
-          .argv
-        )
+        .config('settings', 'pork chop sandwiches')
+        .help('help')
+        .version(false)
+        .wrap(null)
+        .parse()
+      )
       r.should.have.property('logs').with.length(1)
       r.logs.join('\n').split(/\n+/).should.deep.equal([
         'Options:',
@@ -720,11 +720,11 @@ describe('validation tests', () => {
     it('outputs an error returned by the parsing function', () => {
       const checkUsage = require('./helpers/utils').checkOutput
       const r = checkUsage(() => yargs(['--settings=./package.json'])
-          .config('settings', 'path to config file', configPath => Error('someone set us up the bomb'))
-          .help('help')
-          .wrap(null)
-          .argv
-        )
+        .config('settings', 'path to config file', configPath => Error('someone set us up the bomb'))
+        .help('help')
+        .wrap(null)
+        .parse()
+      )
 
       r.errors.join('\n').split(/\n+/).should.deep.equal([
         'Options:',
@@ -738,12 +738,12 @@ describe('validation tests', () => {
     it('outputs an error if thrown by the parsing function', () => {
       const checkUsage = require('./helpers/utils').checkOutput
       const r = checkUsage(() => yargs(['--settings=./package.json'])
-          .config('settings', 'path to config file', (configPath) => {
-            throw Error('someone set us up the bomb')
-          })
-          .wrap(null)
-          .argv
-        )
+        .config('settings', 'path to config file', (configPath) => {
+          throw Error('someone set us up the bomb')
+        })
+        .wrap(null)
+        .parse()
+      )
 
       r.errors.join('\n').split(/\n+/).should.deep.equal([
         'Options:',
@@ -776,15 +776,15 @@ describe('validation tests', () => {
     it('does not fail when command with subcommands called', () => {
       yargs('one')
         .command('one', 'level one', yargs => yargs
-            .command('twoA', 'level two A')
-            .command('twoB', 'level two B')
-            .strict()
-            .fail((msg) => {
-              expect.fail()
-            }), (argv) => {
-              argv._[0].should.equal('one')
-            })
-        .argv
+          .command('twoA', 'level two A')
+          .command('twoB', 'level two B')
+          .strict()
+          .fail((msg) => {
+            expect.fail()
+          }), (argv) => {
+          argv._[0].should.equal('one')
+        })
+        .parse()
     })
 
     it('does not fail for hidden options', () => {
@@ -794,7 +794,7 @@ describe('validation tests', () => {
         .fail((msg) => {
           expect.fail()
         })
-        .argv
+        .parse()
       args.foo.should.equal(true)
     })
 
@@ -807,7 +807,7 @@ describe('validation tests', () => {
         .fail((msg) => {
           expect.fail()
         })
-        .argv
+        .parse()
       args.cat.should.equal(true)
       args.foo.should.equal(true)
       args.bar.should.equal(true)
@@ -822,7 +822,7 @@ describe('validation tests', () => {
           msg.should.equal('Missing required argument: b')
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('allows demandOption in option shorthand', (done) => {
@@ -834,23 +834,23 @@ describe('validation tests', () => {
           msg.should.equal('Missing required argument: c')
           return done()
         })
-        .argv
+        .parse()
     })
   })
 
   describe('demandCommand', () => {
     it('should return a custom failure message when too many non-hyphenated arguments are found after a demand count', () => {
       const r = checkUsage(() => yargs(['src', 'dest'])
-          .usage('Usage: $0 [x] [y] [z] {OPTIONS} <src> <dest> [extra_files...]')
-          .demandCommand(0, 1, 'src and dest files are both required', 'too many arguments are provided')
-          .wrap(null)
-          .help(false)
-          .version(false)
-          .argv
-        )
+        .usage('Usage: $0 [x] [y] [z] {OPTIONS} <src> <dest> [extra_files...]')
+        .demandCommand(0, 1, 'src and dest files are both required', 'too many arguments are provided')
+        .wrap(null)
+        .help(false)
+        .version(false)
+        .parse()
+      )
       r.should.have.property('result')
       r.should.have.property('logs').with.length(0)
-      r.should.have.property('exit').and.be.ok
+      r.should.have.property('exit').and.to.equal(true)
       r.result.should.have.property('_').and.deep.equal(['src', 'dest'])
       r.errors.join('\n').split(/\n+/).should.deep.equal([
         'Usage: usage [x] [y] [z] {OPTIONS} <src> <dest> [extra_files...]',
@@ -866,7 +866,7 @@ describe('validation tests', () => {
           msg.should.equal('totes got 1 totes expected 2')
           return done()
         })
-        .argv
+        .parse()
     })
 
     // see: https://github.com/yargs/yargs/pull/438
@@ -877,7 +877,7 @@ describe('validation tests', () => {
           msg.should.equal('totes too many, got 3 totes expected 2')
           return done()
         })
-        .argv
+        .parse()
     })
 
     it('defaults to demanding 1 command', (done) => {
@@ -887,7 +887,7 @@ describe('validation tests', () => {
           msg.should.equal('Not enough non-option arguments: got 0, need at least 1')
           return done()
         })
-        .argv
+        .parse()
     })
   })
 })
diff --git a/test/yargs.js b/test/yargs.js
index 3f2f553..1feb493 100644
--- a/test/yargs.js
+++ b/test/yargs.js
@@ -25,17 +25,17 @@ describe('yargs dsl tests', () => {
     process.argv[1] = '/usr/local/bin/ndm'
     process.env._ = '/usr/local/bin/ndm'
     process.execPath = '/usr/local/bin/ndm'
-    const argv = yargs([]).argv
+    const argv = yargs([]).parse()
     argv['$0'].should.eql('ndm')
   })
 
   it('accepts an object for aliases', () => {
     const argv = yargs([])
-    .alias({
-      cool: 'cat'
-    })
-    .default('cool', 33)
-    .argv
+      .alias({
+        cool: 'cat'
+      })
+      .default('cool', 33)
+      .parse()
 
     argv.cat.should.eql(33)
   })
@@ -43,31 +43,31 @@ describe('yargs dsl tests', () => {
   it('populates argv with placeholder keys for all options', () => {
     const argv = yargs([])
       .option('cool', {})
-      .argv
+      .parse()
 
     Object.keys(argv).should.include('cool')
   })
 
   it('accepts an object for implies', () => {
     const r = checkOutput(() => yargs(['--x=33'])
-        .implies({
-          x: 'y'
-        })
-        .argv
-      )
+      .implies({
+        x: 'y'
+      })
+      .parse()
+    )
 
     r.errors[2].should.match(/Implications failed/)
   })
 
   it('accepts an object for describes', () => {
     const r = checkOutput(() => yargs([])
-        .describe({
-          x: 'really cool key'
-        })
-        .demand('x')
-        .wrap(null)
-        .argv
-      )
+      .describe({
+        x: 'really cool key'
+      })
+      .demand('x')
+      .wrap(null)
+      .parse()
+    )
 
     r.errors[0].should.match(/really cool key/)
     r.result.should.have.property('x')
@@ -83,7 +83,7 @@ describe('yargs dsl tests', () => {
         msg.should.match(/Implications failed/)
         return done()
       })
-      .argv
+      .parse()
   })
 
   it('should set alias to string if option is string', () => {
@@ -92,7 +92,7 @@ describe('yargs dsl tests', () => {
         alias: 'cat',
         string: true
       })
-      .argv
+      .parse()
 
     argv.cat.should.eql('99')
     argv.c.should.eql('99')
@@ -103,7 +103,7 @@ describe('yargs dsl tests', () => {
       .option('looks', {
         choices: ['good', 'bad']
       })
-      .argv
+      .parse()
 
     argv.looks.should.eql('good')
   })
@@ -122,9 +122,9 @@ describe('yargs dsl tests', () => {
 
   it('should not require config object for an option', () => {
     const r = checkOutput(() => yargs([])
-        .option('x')
-        .argv
-      )
+      .option('x')
+      .parse()
+    )
 
     expect(r.errors).to.deep.equal([])
   })
@@ -168,20 +168,20 @@ describe('yargs dsl tests', () => {
   describe('showHelpOnFail', () => {
     it('should display custom failure message, if string is provided as first argument', () => {
       const r = checkOutput(() => yargs([])
-          .showHelpOnFail('pork chop sandwiches')
-          .demand('cat')
-          .argv
-        )
+        .showHelpOnFail('pork chop sandwiches')
+        .demand('cat')
+        .parse()
+      )
 
       r.errors[4].should.match(/pork chop sandwiches/)
     })
 
     it('calling with no arguments should default to displaying help', () => {
       const r = checkOutput(() => yargs([])
-          .showHelpOnFail()
-          .demand('cat')
-          .argv
-        )
+        .showHelpOnFail()
+        .demand('cat')
+        .parse()
+      )
 
       r.errors[2].should.match(/required argument/)
     })
@@ -196,7 +196,7 @@ describe('yargs dsl tests', () => {
               .demand('cat')
               .showHelpOnFail(false)
               .exitProcess(false)
-              .argv
+              .parse()
           }).to.throw(/Missing required argument/)
         })
       })
@@ -207,7 +207,7 @@ describe('yargs dsl tests', () => {
               .demand('cat')
               .showHelpOnFail(false)
               .exitProcess(false)
-              .argv
+              .parse()
           } catch (err) {
             // ignore the error, we only test the output here
           }
@@ -218,10 +218,10 @@ describe('yargs dsl tests', () => {
     })
     it('should set exit process to true, if no argument provided', () => {
       const r = checkOutput(() => yargs([])
-          .demand('cat')
-          .exitProcess()
-          .argv
-        )
+        .demand('cat')
+        .exitProcess()
+        .parse()
+      )
 
       r.exit.should.eql(true)
     })
@@ -245,7 +245,7 @@ describe('yargs dsl tests', () => {
         .implies('foo', 'snuh')
         .conflicts('qux', 'xyzzy')
         .group('foo', 'Group:')
-        .exitProcess(false)  // defaults to true.
+        .exitProcess(false) // defaults to true.
         .global('foo', false)
         .global('qux', false)
         .env('YARGS')
@@ -323,7 +323,7 @@ describe('yargs dsl tests', () => {
           }
         )
         .exitProcess(false) // defaults to true.
-        .argv
+        .parse()
     })
     it('runs all middleware before reaching the handler', function (done) {
       yargs(['foo'])
@@ -337,19 +337,19 @@ describe('yargs dsl tests', () => {
             argv.hello.should.equal('world')
             return done()
           },
-        [function (argv) {
-          return {hello: 'world'}
-        }]
+          [function (argv) {
+            return {hello: 'world'}
+          }]
         )
         .exitProcess(false) // defaults to true.
-        .argv
+        .parse()
     })
     it('recommends a similar command if no command handler is found', () => {
       const r = checkOutput(() => {
         yargs(['boat'])
           .command('goat')
           .recommendCommands()
-          .argv
+          .parse()
       })
 
       r.errors[2].should.match(/Did you mean goat/)
@@ -360,10 +360,10 @@ describe('yargs dsl tests', () => {
         yargs(['foo'])
           .command('nothingSimilar')
           .recommendCommands()
-          .argv
+          .parse()
       })
 
-      r.logs.should.be.empty
+      r.logs.length.should.equal(0)
     })
 
     it('recommends the longest match first', () => {
@@ -372,7 +372,7 @@ describe('yargs dsl tests', () => {
           .command('bot')
           .command('goat')
           .recommendCommands()
-          .argv
+          .parse()
       })
 
       r.errors[2].should.match(/Did you mean goat/)
@@ -399,15 +399,15 @@ describe('yargs dsl tests', () => {
             'blerg',
             'handle blerg things',
             yargs => yargs
-                .command('snuh', 'snuh command')
-                .help('h')
-                .wrap(null),
+              .command('snuh', 'snuh command')
+              .help('h')
+              .wrap(null),
             () => {
               throw Error('should not happen')
             }
           )
           .help('h')
-          .argv
+          .parse()
       })
 
       r.logs[0].split('\n').should.deep.equal([
@@ -428,13 +428,13 @@ describe('yargs dsl tests', () => {
       const r = checkOutput(() => {
         yargs(['snuh', '-h'])
           .command('blerg', 'handle blerg things', yargs => yargs
-              .command('snuh', 'snuh command')
-              .help('h')
-              .argv
-            )
+            .command('snuh', 'snuh command')
+            .help('h')
+            .parse()
+          )
           .help('h')
           .wrap(null)
-          .argv
+          .parse()
       })
 
       r.logs[0].split('\n').should.deep.equal([
@@ -462,7 +462,7 @@ describe('yargs dsl tests', () => {
           })
           .help('h')
           .wrap(null)
-          .argv
+          .parse()
       })
 
       const usageString = r.logs[0]
@@ -474,7 +474,7 @@ describe('yargs dsl tests', () => {
     it("accepts a module with a 'builder' and 'handler' key", () => {
       const argv = yargs(['blerg', 'bar'])
         .command('blerg <foo>', 'handle blerg things', require('./fixtures/command'))
-        .argv
+        .parse()
 
       argv.banana.should.equal('cool')
       argv.batman.should.equal('sad')
@@ -489,7 +489,7 @@ describe('yargs dsl tests', () => {
     it("accepts a module with a keys 'command', 'describe', 'builder', and 'handler'", () => {
       const argv = yargs(['blerg', 'bar'])
         .command(require('./fixtures/command-module'))
-        .argv
+        .parse()
 
       argv.banana.should.equal('cool')
       argv.batman.should.equal('sad')
@@ -504,7 +504,7 @@ describe('yargs dsl tests', () => {
     it('derives \'command\' string from filename when missing', () => {
       const argv = yargs('nameless --foo bar')
         .command(require('./fixtures/cmddir_noname/nameless'))
-        .argv
+        .parse()
 
       argv.banana.should.equal('cool')
       argv.batman.should.equal('sad')
@@ -541,7 +541,7 @@ describe('yargs dsl tests', () => {
     it('accepts number arguments when a number type is specified', () => {
       const argv = yargs('-w banana')
         .number('w')
-        .argv
+        .parse()
 
       expect(typeof argv.w).to.equal('number')
     })
@@ -552,7 +552,7 @@ describe('yargs dsl tests', () => {
           number: true
         })
         .alias('w', 'x')
-        .argv
+        .parse()
 
       expect(typeof argv.w).to.equal('number')
       expect(typeof argv.x).to.equal('number')
@@ -625,7 +625,7 @@ describe('yargs dsl tests', () => {
           .help('h')
           .wrap(null)
           .detectLocale(false)
-          .argv
+          .parse()
       })
 
       yargs.locale().should.equal('en')
@@ -649,7 +649,7 @@ describe('yargs dsl tests', () => {
           .help('h')
           .wrap(null)
           .locale('pirate')
-          .argv
+          .parse()
       })
 
       r.logs.join(' ').should.match(/Choose yer command:/)
@@ -663,7 +663,7 @@ describe('yargs dsl tests', () => {
           .command('blerg', 'blerg command')
           .help('h')
           .wrap(null)
-          .argv
+          .parse()
       })
 
       yargs.locale().should.equal('zz_ZZ')
@@ -678,7 +678,7 @@ describe('yargs dsl tests', () => {
         yargs(['-h'])
           .help('h')
           .wrap(null)
-          .argv
+          .parse()
       })
 
       yargs.locale().should.equal('pt_BR')
@@ -703,7 +703,7 @@ describe('yargs dsl tests', () => {
           .locale('pirate')
           .help('h')
           .wrap(null)
-          .argv
+          .parse()
       })
 
       r.logs.join(' ').should.match(/Parlay this here code of conduct/)
@@ -715,7 +715,7 @@ describe('yargs dsl tests', () => {
           .help('h')
           .locale('pirate')
           .wrap(null)
-          .argv
+          .parse()
       })
 
       r.logs.join(' ').should.match(/Parlay this here code of conduct/)
@@ -731,7 +731,7 @@ describe('yargs dsl tests', () => {
             .updateLocale({
               'Commands:': 'COMMANDS!'
             })
-            .argv
+            .parse()
         })
 
         r.logs.join(' ').should.match(/COMMANDS!/)
@@ -746,7 +746,7 @@ describe('yargs dsl tests', () => {
             .updateStrings({
               'Commands:': '!SDNAMMOC'
             })
-            .argv
+            .parse()
         })
 
         r.logs.join(' ').should.match(/!SDNAMMOC/)
@@ -777,14 +777,14 @@ describe('yargs dsl tests', () => {
 
     it('translates false as undefined prefix (disables parsing of env vars)', () => {
       const options = yargs.env(false).getOptions()
-      expect(options.envPrefix).to.be.undefined
+      expect(options.envPrefix).to.equal(undefined)
     })
   })
 
   describe('parse', () => {
     it('parses a simple string', () => {
       const a1 = yargs.parse('-x=2 --foo=bar')
-      const a2 = yargs('-x=2 --foo=bar').argv
+      const a2 = yargs('-x=2 --foo=bar').parse()
       a1.x.should.equal(2)
       a2.x.should.equal(2)
 
@@ -794,7 +794,7 @@ describe('yargs dsl tests', () => {
 
     it('parses a quoted string', () => {
       const a1 = yargs.parse('-x=\'marks "the" spot\' --foo "break \'dance\'"')
-      const a2 = yargs('-x=\'marks "the" spot\' --foo "break \'dance\'"').argv
+      const a2 = yargs('-x=\'marks "the" spot\' --foo "break \'dance\'"').parse()
 
       a1.x.should.equal('marks "the" spot')
       a2.x.should.equal('marks "the" spot')
@@ -805,7 +805,7 @@ describe('yargs dsl tests', () => {
 
     it('parses an array', () => {
       const a1 = yargs.parse(['-x', '99', '--why=hello world'])
-      const a2 = yargs(['-x', '99', '--why=hello world']).argv
+      const a2 = yargs(['-x', '99', '--why=hello world']).parse()
 
       a1.x.should.equal(99)
       a2.x.should.equal(99)
@@ -836,7 +836,7 @@ describe('yargs dsl tests', () => {
       a1.x.should.equal(42)
     })
 
-    it('parses process.argv if no arguments are provided', () => {
+    it('parses process.parse() if no arguments are provided', () => {
       const r = checkOutput(() => {
         yargs(['--help'])
           .command('blerg', 'blerg command')
@@ -912,14 +912,14 @@ describe('yargs dsl tests', () => {
           .help()
           .parse('--help', () => {
             callbackCalled = true
-            yargs.getExitProcess().should.be.false
+            yargs.getExitProcess().should.equal(false)
           })
       })
       r.logs.length.should.equal(0)
       r.errors.length.should.equal(0)
-      r.exit.should.be.false
-      callbackCalled.should.be.true
-      yargs.getExitProcess().should.be.true
+      r.exit.should.equal(false)
+      callbackCalled.should.equal(true)
+      yargs.getExitProcess().should.equal(true)
     })
 
     it('does not call callback if subsequently called without callback', () => {
@@ -937,8 +937,8 @@ describe('yargs dsl tests', () => {
       callbackCalled.should.equal(1)
       r1.logs.length.should.equal(0)
       r1.errors.length.should.equal(0)
-      r1.exit.should.be.false
-      r2.exit.should.be.true
+      r1.exit.should.equal(false)
+      r2.exit.should.equal(true)
       r2.errors.length.should.equal(0)
       r2.logs[0].should.match(/--help.*Show help.*\[boolean]/)
     })
@@ -1221,7 +1221,7 @@ describe('yargs dsl tests', () => {
       const argv = yargs('--config ./test/fixtures/config.json')
         .config('config', cfgPath => JSON.parse(fs.readFileSync(cfgPath)))
         .global('config', false)
-        .argv
+        .parse()
 
       argv.foo.should.equal('baz')
     })
@@ -1232,7 +1232,7 @@ describe('yargs dsl tests', () => {
           config: true,
           global: false
         })
-        .argv
+        .parse()
 
       argv.foo.should.equal('baz')
     })
@@ -1243,15 +1243,15 @@ describe('yargs dsl tests', () => {
           config: false,
           global: false
         })
-        .argv
+        .parse()
 
       argv.config.should.equal('./test/fixtures/config.json')
     })
 
     it('allows to pass a configuration object', () => {
       const argv = yargs
-          .config({foo: 1, bar: 2})
-          .argv
+        .config({foo: 1, bar: 2})
+        .parse()
 
       argv.foo.should.equal(1)
       argv.bar.should.equal(2)
@@ -1264,7 +1264,7 @@ describe('yargs dsl tests', () => {
             extends: './test/fixtures/extends/config_1.json',
             a: 1
           })
-          .argv
+          .parse()
 
         argv.a.should.equal(1)
         argv.b.should.equal(22)
@@ -1285,7 +1285,7 @@ describe('yargs dsl tests', () => {
             a: 2,
             extends: absolutePath
           })
-          .argv
+          .parse()
 
         argv.a.should.equal(2)
         argv.b.should.equal(22)
@@ -1299,7 +1299,7 @@ describe('yargs dsl tests', () => {
             a: 2,
             extends: 'yargs-test-extends'
           })
-          .argv
+          .parse()
 
         argv.a.should.equal(2)
         argv.c.should.equal(201)
@@ -1311,7 +1311,7 @@ describe('yargs dsl tests', () => {
             a: 2,
             extends: 'batman'
           })
-          .argv
+          .parse()
 
         argv.a.should.equal(2)
         argv.extends.should.equal('batman')
@@ -1323,7 +1323,7 @@ describe('yargs dsl tests', () => {
             extends: './test/fixtures/extends/.myrc',
             a: 3
           })
-          .argv
+          .parse()
 
         argv.a.should.equal(3)
         argv.b.should.equal(22)
@@ -1337,7 +1337,7 @@ describe('yargs dsl tests', () => {
     it('normalizes paths passed as arguments', () => {
       const argv = yargs('--path /foo/bar//baz/asdf/quux/..')
         .normalize(['path'])
-        .argv
+        .parse()
 
       argv.path.should.equal(['', 'foo', 'bar', 'baz', 'asdf'].join(path.sep))
     })
@@ -1345,7 +1345,7 @@ describe('yargs dsl tests', () => {
     it('normalizes path when when it is updated', () => {
       const argv = yargs('--path /batman')
         .normalize(['path'])
-        .argv
+        .parse()
 
       argv.path = '/foo/bar//baz/asdf/quux/..'
       argv.path.should.equal(['', 'foo', 'bar', 'baz', 'asdf'].join(path.sep))
@@ -1356,7 +1356,7 @@ describe('yargs dsl tests', () => {
         .option('path', {
           normalize: true
         })
-        .argv
+        .parse()
 
       argv.path = '/foo/bar//baz/asdf/quux/..'
       argv.path.should.equal(['', 'foo', 'bar', 'baz', 'asdf'].join(path.sep))
@@ -1367,7 +1367,7 @@ describe('yargs dsl tests', () => {
         .option('path', {
           normalize: false
         })
-        .argv
+        .parse()
 
       argv.path = 'mongodb://url'
       argv.path.should.equal('mongodb://url')
@@ -1378,7 +1378,7 @@ describe('yargs dsl tests', () => {
     it('accepts a key as the first argument and a count as the second', () => {
       const argv = yargs('--foo a b c')
         .nargs('foo', 2)
-        .argv
+        .parse()
 
       argv.foo.should.deep.equal(['a', 'b'])
       argv._.should.deep.equal(['c'])
@@ -1389,7 +1389,7 @@ describe('yargs dsl tests', () => {
         .nargs({
           foo: 2
         })
-        .argv
+        .parse()
 
       argv.foo.should.deep.equal(['a', 'b'])
       argv._.should.deep.equal(['c'])
@@ -1400,7 +1400,7 @@ describe('yargs dsl tests', () => {
         .option('foo', {
           nargs: 2
         })
-        .argv
+        .parse()
 
       argv.foo.should.deep.equal(['a', 'b'])
       argv._.should.deep.equal(['c'])
@@ -1512,7 +1512,7 @@ describe('yargs dsl tests', () => {
 
   describe('pkgConf', () => {
     it('uses values from package.json', () => {
-      const argv = yargs('--foo a').pkgConf('repository').argv
+      const argv = yargs('--foo a').pkgConf('repository').parse()
 
       argv.foo.should.equal('a')
       argv.type.should.equal('git')
@@ -1522,7 +1522,7 @@ describe('yargs dsl tests', () => {
       const argv = yargs('--foo a')
         .default('b', 99)
         .pkgConf('repository')
-        .argv
+        .parse()
 
       argv.b.should.equal(99)
       argv.foo.should.equal('a')
@@ -1534,7 +1534,7 @@ describe('yargs dsl tests', () => {
         .default('b', 99)
         .pkgConf('repository')
         .default('type', 'default')
-        .argv
+        .parse()
 
       argv.b.should.equal(99)
       argv.foo.should.equal('a')
@@ -1546,7 +1546,7 @@ describe('yargs dsl tests', () => {
         .pkgConf('repository')
         .alias('type', 't')
         .alias('t', 'u')
-        .argv
+        .parse()
 
       argv.foo.should.equal('a')
       argv.type.should.equal('git')
@@ -1558,7 +1558,7 @@ describe('yargs dsl tests', () => {
       const argv = yargs('--foo a')
         .default('b', 99)
         .pkgConf('banana')
-        .argv
+        .parse()
 
       argv.b.should.equal(99)
       argv.foo.should.equal('a')
@@ -1568,7 +1568,7 @@ describe('yargs dsl tests', () => {
     it('allows an alternative cwd to be specified', () => {
       const argv = yargs('--foo a')
         .pkgConf('yargs', './test/fixtures')
-        .argv
+        .parse()
 
       argv.foo.should.equal('a')
       argv.dotNotation.should.equal(false)
@@ -1576,16 +1576,16 @@ describe('yargs dsl tests', () => {
 
     it('doesn\'t mess up other pkg lookups when cwd is specified', () => {
       const r = checkOutput(() => yargs('--version')
-          .pkgConf('repository', './test/fixtures')
-          .version()
-          .argv
-        )
+        .pkgConf('repository', './test/fixtures')
+        .version()
+        .parse()
+      )
       const options = yargs.getOptions()
 
       // assert pkgConf lookup (test/fixtures/package.json)
       options.configObjects.should.deep.equal([{ type: 'svn' }])
       // assert parseArgs and guessVersion lookup (package.json)
-      expect(options.configuration['dot-notation']).to.be.undefined
+      expect(options.configuration['dot-notation']).to.equal(undefined)
       r.logs[0].should.not.equal('9.9.9') // breaks when yargs gets to this version
     })
 
@@ -1593,20 +1593,20 @@ describe('yargs dsl tests', () => {
     it('handles an invalid package.json', () => {
       const argv = yargs('--foo a')
         .pkgConf('yargs', './test/fixtures/broken-json')
-        .argv
+        .parse()
 
       argv.foo.should.equal('a')
     })
 
     it('should apply default configurations from extended packages', () => {
-      const argv = yargs().pkgConf('foo', 'test/fixtures/extends/packageA').argv
+      const argv = yargs().pkgConf('foo', 'test/fixtures/extends/packageA').parse()
 
       argv.a.should.equal(80)
       argv.b.should.equals('riffiwobbles')
     })
 
     it('should apply extended configurations from cwd when no path is given', () => {
-      const argv = yargs('', 'test/fixtures/extends/packageA').pkgConf('foo').argv
+      const argv = yargs('', 'test/fixtures/extends/packageA').pkgConf('foo').parse()
 
       argv.a.should.equal(80)
       argv.b.should.equals('riffiwobbles')
@@ -1616,48 +1616,48 @@ describe('yargs dsl tests', () => {
   describe('skipValidation', () => {
     it('skips validation if an option with skipValidation is present', () => {
       const argv = yargs(['--koala', '--skip'])
-          .demand(1)
-          .fail((msg) => {
-            expect.fail()
-          })
-          .skipValidation(['skip', 'reallySkip'])
-          .argv
+        .demand(1)
+        .fail((msg) => {
+          expect.fail()
+        })
+        .skipValidation(['skip', 'reallySkip'])
+        .parse()
       argv.koala.should.equal(true)
     })
 
     it('does not skip validation if no option with skipValidation is present', (done) => {
       const argv = yargs(['--koala'])
-          .demand(1)
-          .fail(msg => done())
-          .skipValidation(['skip', 'reallySkip'])
-          .argv
+        .demand(1)
+        .fail(msg => done())
+        .skipValidation(['skip', 'reallySkip'])
+        .parse()
       argv.koala.should.equal(true)
     })
 
     it('allows key to be specified with option shorthand', () => {
       const argv = yargs(['--koala', '--skip'])
-          .demand(1)
-          .fail((msg) => {
-            expect.fail()
-          })
-          .option('skip', {
-            skipValidation: true
-          })
-          .argv
+        .demand(1)
+        .fail((msg) => {
+          expect.fail()
+        })
+        .option('skip', {
+          skipValidation: true
+        })
+        .parse()
       argv.koala.should.equal(true)
     })
 
     it('allows having an option that skips validation but not skipping validation if that option is not used', () => {
       let skippedValidation = true
       yargs(['--no-skip'])
-          .demand(5)
-          .option('skip', {
-            skipValidation: true
-          })
-          .fail((msg) => {
-            skippedValidation = false
-          })
-          .argv
+        .demand(5)
+        .option('skip', {
+          skipValidation: true
+        })
+        .fail((msg) => {
+          skippedValidation = false
+        })
+        .parse()
       expect(skippedValidation).to.equal(false)
     })
   })
@@ -1665,13 +1665,13 @@ describe('yargs dsl tests', () => {
   describe('.help()', () => {
     it('enables `--help` option and `help` command without arguments', () => {
       const option = checkOutput(() => yargs('--help')
-          .wrap(null)
-          .argv
-        )
+        .wrap(null)
+        .parse()
+      )
       const command = checkOutput(() => yargs('help')
-          .wrap(null)
-          .argv
-        )
+        .wrap(null)
+        .parse()
+      )
       const expected = [
         'Options:',
         '  --help     Show help  [boolean]',
@@ -1683,15 +1683,15 @@ describe('yargs dsl tests', () => {
 
     it('enables `--help` option and `help` command with `true` argument', () => {
       const option = checkOutput(() => yargs('--help')
-          .help(true)
-          .wrap(null)
-          .argv
-        )
+        .help(true)
+        .wrap(null)
+        .parse()
+      )
       const command = checkOutput(() => yargs('help')
-          .help(true)
-          .wrap(null)
-          .argv
-        )
+        .help(true)
+        .wrap(null)
+        .parse()
+      )
       const expected = [
         'Options:',
         '  --version  Show version number  [boolean]',
@@ -1703,20 +1703,20 @@ describe('yargs dsl tests', () => {
 
     it('enables given string as help option and command with string argument', () => {
       const option = checkOutput(() => yargs('--info')
-          .help('info')
-          .wrap(null)
-          .argv
-        )
+        .help('info')
+        .wrap(null)
+        .parse()
+      )
       const command = checkOutput(() => yargs('info')
-          .help('info')
-          .wrap(null)
-          .argv
-        )
+        .help('info')
+        .wrap(null)
+        .parse()
+      )
       const helpOption = checkOutput(() => yargs('--help')
-          .help('info')
-          .wrap(null)
-          .argv
-        )
+        .help('info')
+        .wrap(null)
+        .parse()
+      )
       const expected = [
         'Options:',
         '  --version  Show version number  [boolean]',
@@ -1724,20 +1724,20 @@ describe('yargs dsl tests', () => {
       ]
       option.logs[0].split('\n').should.deep.equal(expected)
       command.logs[0].split('\n').should.deep.equal(expected)
-      helpOption.result.should.have.property('help').and.be.true
+      helpOption.result.should.have.property('help').and.equal(true)
     })
 
     it('enables given string as help option and command with custom description with two string arguments', () => {
       const option = checkOutput(() => yargs('--info')
-          .help('info', 'Display info')
-          .wrap(null)
-          .argv
-        )
+        .help('info', 'Display info')
+        .wrap(null)
+        .parse()
+      )
       const command = checkOutput(() => yargs('info')
-          .help('info', 'Display info')
-          .wrap(null)
-          .argv
-        )
+        .help('info', 'Display info')
+        .wrap(null)
+        .parse()
+      )
       const expected = [
         'Options:',
         '  --version  Show version number  [boolean]',
@@ -1749,15 +1749,15 @@ describe('yargs dsl tests', () => {
 
     it('enables given string as help option and command with custom description with two string arguments and `true` argument', () => {
       const option = checkOutput(() => yargs('--info')
-          .help('info', 'Display info', true)
-          .wrap(null)
-          .argv
-        )
+        .help('info', 'Display info', true)
+        .wrap(null)
+        .parse()
+      )
       const command = checkOutput(() => yargs('info')
-          .help('info', 'Display info', true)
-          .wrap(null)
-          .argv
-        )
+        .help('info', 'Display info', true)
+        .wrap(null)
+        .parse()
+      )
       const expected = [
         'Options:',
         '  --version  Show version number  [boolean]',
@@ -1771,15 +1771,15 @@ describe('yargs dsl tests', () => {
   describe('.help() with .alias()', () => {
     it('uses multi-char (but not single-char) help alias as command', () => {
       const info = checkOutput(() => yargs('info')
-          .help().alias('h', 'help').alias('h', 'info')
-          .wrap(null)
-          .argv
-        )
+        .help().alias('h', 'help').alias('h', 'info')
+        .wrap(null)
+        .parse()
+      )
       const h = checkOutput(() => yargs('h')
-          .help().alias('h', 'help').alias('h', 'info')
-          .wrap(null)
-          .argv
-        )
+        .help().alias('h', 'help').alias('h', 'info')
+        .wrap(null)
+        .parse()
+      )
       info.logs[0].split('\n').should.deep.equal([
         'Options:',
         '  --version           Show version number  [boolean]',
@@ -1793,7 +1793,7 @@ describe('yargs dsl tests', () => {
     it('supports string and function args (as option key and coerce function)', () => {
       const argv = yargs(['--file', path.join(__dirname, 'fixtures', 'package.json')])
         .coerce('file', arg => JSON.parse(fs.readFileSync(arg, 'utf8')))
-        .argv
+        .parse()
       expect(argv.file).to.have.property('version').and.equal('9.9.9')
     })
 
@@ -1808,7 +1808,7 @@ describe('yargs dsl tests', () => {
             return { begin: arr[0], end: arr[1] }
           }
         })
-        .argv
+        .parse()
       expect(argv.expand).to.deep.equal(['a', 'b', 'c'])
       expect(argv.range).to.have.property('begin').and.equal(1)
       expect(argv.range).to.have.property('end').and.equal(3)
@@ -1817,7 +1817,7 @@ describe('yargs dsl tests', () => {
     it('supports array and function args (as option keys and coerce function)', () => {
       const argv = yargs(['--src', 'in', '--dest', 'out'])
         .coerce(['src', 'dest'], arg => path.resolve(arg))
-        .argv
+        .parse()
       argv.src.should.match(/in/).and.have.length.above(2)
       argv.dest.should.match(/out/).and.have.length.above(3)
     })
@@ -1839,16 +1839,16 @@ describe('yargs dsl tests', () => {
           msg = m
           err = e
         })
-        .argv
+        .parse()
       expect(msg).to.equal(jsonErrMessage)
-      expect(err).to.exist
+      expect(err).to.not.equal(undefined)
     })
 
     it('supports an option alias', () => {
       const argv = yargs('-d 2016-08-12')
         .coerce('date', Date.parse)
         .alias('date', 'd')
-        .argv
+        .parse()
       argv.date.should.equal(1470960000000)
     })
 
@@ -1860,7 +1860,7 @@ describe('yargs dsl tests', () => {
         .command('check', 'Check something', {}, (argv) => {
           regex = argv.regex
         })
-        .argv
+        .parse()
       expect(regex).to.be.an.instanceof(RegExp)
       regex.toString().should.equal('/x/')
     })
@@ -1873,7 +1873,7 @@ describe('yargs dsl tests', () => {
             return { name: arr[0], value: arr[1] || '' }
           }
         })
-        .argv
+        .parse()
       expect(argv.env).to.have.property('name').and.equal('SHELL')
       expect(argv.env).to.have.property('value').and.equal('/bin/bash')
     })
@@ -1883,12 +1883,12 @@ describe('yargs dsl tests', () => {
       let dates
       yargs('add 30days 2016-06-13 2016-07-18')
         .command('add <age> [dates..]', 'Testing', yargs => yargs
-            .coerce('age', arg => parseInt(arg, 10) * 86400000)
-            .coerce('dates', arg => arg.map(str => new Date(str))), (argv) => {
-              age = argv.age
-              dates = argv.dates
-            })
-        .argv
+          .coerce('age', arg => parseInt(arg, 10) * 86400000)
+          .coerce('dates', arg => arg.map(str => new Date(str))), (argv) => {
+          age = argv.age
+          dates = argv.dates
+        })
+        .parse()
       expect(age).to.equal(2592000000)
       expect(dates).to.have.lengthOf(2)
       dates[0].toString().should.equal(new Date('2016-06-13').toString())
@@ -1901,13 +1901,13 @@ describe('yargs dsl tests', () => {
       let dates
       yargs('add 30days 2016-06-13 2016-07-18')
         .command('add <age-in-days> [dates..]', 'Testing', yargs => yargs
-            .coerce('age-in-days', arg => parseInt(arg, 10) * 86400000)
-            .coerce('dates', arg => arg.map(str => new Date(str))), (argv) => {
-              age1 = argv.ageInDays
-              age2 = argv['age-in-days']
-              dates = argv.dates
-            })
-        .argv
+          .coerce('age-in-days', arg => parseInt(arg, 10) * 86400000)
+          .coerce('dates', arg => arg.map(str => new Date(str))), (argv) => {
+          age1 = argv.ageInDays
+          age2 = argv['age-in-days']
+          dates = argv.dates
+        })
+        .parse()
       expect(age1).to.equal(2592000000)
       expect(age2).to.equal(2592000000)
       expect(dates).to.have.lengthOf(2)
@@ -1920,16 +1920,16 @@ describe('yargs dsl tests', () => {
       let err
       yargs('throw ball')
         .command('throw <msg>', false, yargs => yargs
-            .coerce('msg', (arg) => {
-              throw new Error(arg)
-            })
-            .fail((m, e) => {
-              msg = m
-              err = e
-            }))
-        .argv
+          .coerce('msg', (arg) => {
+            throw new Error(arg)
+          })
+          .fail((m, e) => {
+            msg = m
+            err = e
+          }))
+        .parse()
       expect(msg).to.equal('ball')
-      expect(err).to.exist
+      expect(err).to.not.equal(undefined)
     })
   })
 
@@ -1978,7 +1978,7 @@ describe('yargs dsl tests', () => {
         }, (argv) => {
           context.commands.should.deep.equal(['one'])
         })
-        .argv
+        .parse()
       context.commands.should.deep.equal([])
     })
   })
@@ -1991,7 +1991,7 @@ describe('yargs dsl tests', () => {
             describe: 'foo positionals'
           })
         })
-        .argv
+        .parse()
       args.foo.should.eql([])
     })
 
@@ -2006,7 +2006,7 @@ describe('yargs dsl tests', () => {
               describe: 'the variadic bit'
             })
         })
-        .argv
+        .parse()
       args.file.should.equal('/tmp/foo/bar')
       args.foo.should.eql(['a', 'b'])
     })
@@ -2031,7 +2031,7 @@ describe('yargs dsl tests', () => {
           yargs.positional('heroes', {
             default: ['batman', 'Iron Man']
           })
-        }).argv
+        }).parse()
       argv.heroes.should.eql(['batman', 'Iron Man'])
     })
 
@@ -2054,7 +2054,7 @@ describe('yargs dsl tests', () => {
             alias: 'do-gooders',
             default: ['batman', 'robin']
           })
-        }).argv
+        }).parse()
       argv.heroes.should.eql(['batman', 'robin'])
       argv.doGooders.should.eql(['batman', 'robin'])
       argv['do-gooders'].should.eql(['batman', 'robin'])
@@ -2066,7 +2066,7 @@ describe('yargs dsl tests', () => {
           yargs.positional('files', {
             normalize: true
           })
-        }).argv
+        }).parse()
       argv.files.should.eql([
         '/tmp/'.replace(/\//g, path.sep),
         '/tmp/awesome/'.replace(/\//g, path.sep)
@@ -2096,7 +2096,7 @@ describe('yargs dsl tests', () => {
             },
             alias: 'do-gooder'
           })
-        }).argv
+        }).parse()
       argv.hero.should.equal('BATMAN')
       argv.doGooder.should.equal('BATMAN')
     })
@@ -2107,7 +2107,7 @@ describe('yargs dsl tests', () => {
           yargs.positional('run', {
             type: 'boolean'
           })
-        }).argv
+        }).parse()
       argv.run.should.equal(false)
     })
 
@@ -2117,7 +2117,7 @@ describe('yargs dsl tests', () => {
           yargs.positional('count', {
             type: 'number'
           })
-        }).argv
+        }).parse()
       isNaN(argv.count).should.equal(true)
     })
 
@@ -2127,7 +2127,7 @@ describe('yargs dsl tests', () => {
           yargs.positional('str', {
             type: 'string'
           })
-        }).argv
+        }).parse()
       argv.str.should.equal('33')
     })
 
@@ -2139,7 +2139,7 @@ describe('yargs dsl tests', () => {
               type: 'string'
             })
           })
-        }).argv
+        }).parse()
 
       argv.str.should.equal('33')
     })