simple-bin-help
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -19,3 +19,2 @@ function noArguments(minLength, args) { | ||
pkgInfo = pkg.name + '@' + pkg.version + ' - ' + pkg.description; | ||
pkgInfo += '\nis used incorrectly, check out instructions `manpm ' + pkg.name + '`'; | ||
} | ||
@@ -31,2 +30,5 @@ | ||
console.log('Incorrect CLI arguments'); | ||
if (pkg && pkg.name) { | ||
console.log('Check out instructions for this module using `npm home ' + pkg.name + '`'); | ||
} | ||
} | ||
@@ -47,7 +49,6 @@ } | ||
showHelp(options); | ||
if (options.exit) { | ||
process.exit(0); | ||
} else { | ||
if (options.noExit) { | ||
return false; | ||
} | ||
process.exit(0); | ||
} | ||
@@ -54,0 +55,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"main": "index.js", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"scripts": { | ||
@@ -8,0 +8,0 @@ "test": "mocha spec", |
@@ -31,2 +31,20 @@ # simple-bin-help | ||
## Api | ||
Single options object, with the following properties | ||
```js | ||
var options = { | ||
noExit: true | false, // simple-bin-help by default calls process.exit | ||
help: 'help string', // to display if invalid arguments | ||
minArguments: n, // min number of arguments to check | ||
pkg: packageObject, // package object or path for better message | ||
packagePath: 'path/to/package.json' | ||
}; | ||
require('simple-bin-help')(options); | ||
``` | ||
If `noExit` is true, the call simply shows the error message if number of arguments is | ||
invalid and returns a boolean result. | ||
### Small print | ||
@@ -33,0 +51,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6341
47
99