Comparing version 0.3.0 to 0.3.1
14
cli.js
@@ -146,16 +146,16 @@ /** | ||
*/ | ||
cli.setArgv = function (argv, keep_arg0) { | ||
if (typeof argv == 'string') { | ||
argv = argv.split(' '); | ||
cli.setArgv = function (arr, keep_arg0) { | ||
if (typeof arr == 'string') { | ||
arr = arr.split(' '); | ||
} else { | ||
argv = argv.slice(); | ||
arr = arr.slice(); | ||
} | ||
cli.app = argv.shift(); | ||
cli.app = arr.shift(); | ||
//Strip off argv[0] if it's 'node' | ||
if (!keep_arg0 && 'node' === cli.native.path.basename(cli.app)) { | ||
cli.app = argv.shift(); | ||
cli.app = arr.shift(); | ||
} | ||
cli.app = cli.native.path.basename(cli.app); | ||
argv_parsed = false; | ||
cli.args = cli.argv = argv; | ||
cli.args = cli.argv = argv = arr; | ||
cli.argc = argv.length; | ||
@@ -162,0 +162,0 @@ }; |
{ "name" : "cli", | ||
"description" : "A tool for rapidly building command line apps", | ||
"version" : "0.3.0", | ||
"version" : "0.3.1", | ||
"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"], |
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
48835