Comparing version 0.4.5 to 0.5.0
13
cli.js
@@ -145,4 +145,8 @@ /** | ||
cli.app = arr.shift(); | ||
//Strip off argv[0] if it's a node binary | ||
// Strip off argv[0] if it's a node binary | ||
// So this is still broken and will break if you are calling node through a | ||
// symlink, unless you are lucky enough to have it as 'node' literal. Latter | ||
// is a hack, but resolving abspaths/symlinks is an unportable can of worms. | ||
if (!keep_arg0 && ('node' === cli.native.path.basename(cli.app) | ||
|| cli.native.path.basename(process.execPath) === cli.app | ||
|| process.execPath === cli.app)) { | ||
@@ -335,3 +339,2 @@ cli.app = arr.shift(); | ||
cli.getUsage(); | ||
process.exit(); | ||
} else if (enable.version && (o === 'v' || o === 'version')) { | ||
@@ -565,3 +568,3 @@ if (cli.version == null) { | ||
*/ | ||
cli.getUsage = function () { | ||
cli.getUsage = function (code) { | ||
var short, desc, optional, line, seen_opts = [], | ||
@@ -682,3 +685,3 @@ switch_pad = cli.option_width; | ||
} | ||
process.exit(); | ||
process.exit(code); | ||
}; | ||
@@ -805,3 +808,3 @@ | ||
return cli.getValue(default_val, function (value) { | ||
if (value.match(/[?*:;{}]/)) { | ||
if (value.match(/[?*;{}]/)) { | ||
throw 'Invalid path'; | ||
@@ -808,0 +811,0 @@ } |
{ "name" : "cli", | ||
"description" : "A tool for rapidly building command line apps", | ||
"version" : "0.4.5", | ||
"version" : "0.5.0", | ||
"homepage" : "http://github.com/chriso/cli", | ||
@@ -5,0 +5,0 @@ "keywords" : ["cli","command line","opts","parseopt","opt","args","console","argsparse","optparse","daemon","autocomplete","command","autocompletion"], |
@@ -9,3 +9,3 @@ **cli is a toolkit for rapidly building command line apps - it includes:** | ||
Install using `npm install cli` or just bundle [cli.js](https://github.com/chriso/cli/raw/master/cli-min.js) with your app. | ||
Install using `npm install cli` or just bundle [cli.js](https://github.com/chriso/cli/raw/master/cli.js) with your app. | ||
@@ -12,0 +12,0 @@ ## Example apps |
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
49703
1202