Comparing version
@@ -283,3 +283,2 @@ "use strict"; | ||
consumeOption(q) { | ||
var _a; | ||
const next = q.shift(); | ||
@@ -311,5 +310,7 @@ /* istanbul ignore if */ | ||
if (!opt.args) { | ||
optValue = (_a = opt.defaultValue) !== null && _a !== void 0 ? _a : true; | ||
// It's a boolean option flag, set it high | ||
optValue = true; | ||
} | ||
else { | ||
// It's an option with arguments, parse each one | ||
optValue = {}; | ||
@@ -351,3 +352,6 @@ for (const arg of opt.args) { | ||
else { | ||
if (arg.required) { | ||
if (arg.variadic) { | ||
argValue = []; | ||
} | ||
else if (arg.required) { | ||
throw new exceptions_1.ExpectedButGotException(`a value for "${arg.name}"`, 'nothing'); | ||
@@ -354,0 +358,0 @@ } |
{ | ||
"name": "cilly", | ||
"version": "1.0.14", | ||
"version": "1.0.15", | ||
"description": "The last library you'll ever need for building intuitive, robust and flexible CLI tools with Node.js and TypeScript.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -501,3 +501,3 @@ # Cilly | ||
```typescript | ||
new CliCommadn('build') | ||
new CliCommand('build') | ||
.withArguments({ name: 'address', onProcess: async (value, parsed, assign) => { | ||
@@ -504,0 +504,0 @@ if (value === undefined) { |
70641
0.18%1121
0.36%