Skip to content
Permalink
Browse files

use exit code 2 when manually calling `cli.showHelp()`

closes #47
  • Loading branch information...
sindresorhus committed Sep 5, 2016
1 parent 2d4d890 commit 6a32bbc3acc9c41068234d80188e9d2e865f50fa
Showing with 3 additions and 3 deletions.
  1. +2 −2 index.js
  2. +1 −1 readme.md
@@ -58,7 +58,7 @@ module.exports = (opts, minimistOpts) => {

const showHelp = code => {
console.log(help);
process.exit(code || 0);
process.exit(typeof code === 'number' ? code : 2);
};

if (argv.version && opts.version !== false) {
@@ -67,7 +67,7 @@ module.exports = (opts, minimistOpts) => {
}

if (argv.help && opts.help !== false) {
showHelp();
showHelp(0);
}

const input = argv._;
@@ -71,7 +71,7 @@ Returns an `Object` with:
- `flags` *(Object)* - Flags converted to camelCase
- `pkg` *(Object)* - The `package.json` object
- `help` *(string)* - The help text used with `--help`
- `showHelp([code=0])` *(Function)* - Show the help text and exit with `code`
- `showHelp([code=2])` *(Function)* - Show the help text and exit with `code`

#### options

0 comments on commit 6a32bbc

Please sign in to comment.
You can’t perform that action at this time.