Comparing version 1.0.3 to 1.0.4
17
index.js
@@ -332,3 +332,4 @@ var MAX_LINE_WIDTH = process.stdout.columns || 200; | ||
{ | ||
command.args_.apply(command, commandArgs); | ||
//command.args_.apply(command, commandArgs); | ||
resultToken.args = commandArgs; | ||
commandArgs = []; | ||
@@ -390,4 +391,13 @@ } | ||
{ | ||
if (command.commands[token]) | ||
if (command.commands[token] && (!command.params || commandArgs.length >= command.params.minArgsCount)) | ||
{ | ||
if (noOptionsYet) | ||
{ | ||
resultToken.args = commandArgs; | ||
commandArgs = []; | ||
} | ||
if (command.params && resultToken.args.length < command.params.minArgsCount) | ||
throw new ParseError('Missed required argument(s) for command `' + command.name + '`'); | ||
// switch control to another command | ||
@@ -436,2 +446,5 @@ command = command.commands[token]; | ||
resultToken.args = commandArgs; | ||
if (command.params && resultToken.args.length < command.params.minArgsCount) | ||
throw new ParseError('Missed required argument(s) for command `' + command.name + '`'); | ||
} | ||
@@ -438,0 +451,0 @@ |
@@ -6,3 +6,3 @@ { | ||
"author": "Roman Dvornov <rdvornov@gmail.com>", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"keywords": ["cli", "command", "option", "argument", "completion"], | ||
@@ -9,0 +9,0 @@ "homepage": "https://github.com/lahmatiy/clap", |
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
21899
730