Repository: yargs/yargs (js)

Issue:
recommended commands takes precedence over help message
```
slackboard org
```

```
slackboard org <subcommand|help>

Commands:
  add-user      add a user to an org.

Options:
  --help  Show help                                                                        [boolean]

Did you mean get?
```

Pull request description:
fix: help now takes precedence over command recommendation
fixes #854 

Patch:
diff --git a/yargs.js b/yargs.js
index a3eb0c2..078bf8f 100644
--- a/yargs.js
+++ b/yargs.js
@@ -1002,7 +1002,7 @@ function Yargs (processArgs, cwd, parentRequire) {
 
           // recommend a command if recommendCommands() has
           // been enabled, and no commands were found to execute
-          if (recommendCommands && firstUnknownCommand) {
+          if (recommendCommands && firstUnknownCommand && !argv[helpOpt]) {
             validation.recommendCommands(firstUnknownCommand, handlerKeys)
           }
         }


Test patch:
diff --git a/test/yargs.js b/test/yargs.js
index 20a9f26..e831c99 100644
--- a/test/yargs.js
+++ b/test/yargs.js
@@ -338,15 +338,14 @@ describe('yargs dsl tests', function () {
     })
 
     // see: https://github.com/yargs/yargs/issues/822
-    it('does not print help message if recommendation has been made', function (done) {
+    it('does not print command recommendation if help message will be shown', function (done) {
       const parser = yargs()
         .command('goat')
         .help()
         .recommendCommands()
 
       parser.parse('boat help', {}, function (err, _argv, output) {
-        // it should not have printed the help text twice!
-        err.message.should.equal('Did you mean goat?')
+        if (err) return done(err)
         output.split('Commands:').length.should.equal(2)
         return done()
       })