Comparing version 1.0.24 to 1.0.25
@@ -32,2 +32,3 @@ export declare type ArgumentValue = any; | ||
description?: string; | ||
inherited?: boolean; | ||
onParse?: OnParseHook; | ||
@@ -34,0 +35,0 @@ onProcess?: OnProcessHook; |
@@ -73,2 +73,4 @@ "use strict"; | ||
withOptions(...options) { | ||
const localOptions = []; | ||
const inheritedOptions = []; | ||
for (const option of options) { | ||
@@ -83,3 +85,8 @@ this.checkOption(option); | ||
if (!(name in this.opts)) { | ||
this.onProcessQueue.push(option); | ||
if (option.inherited) { | ||
inheritedOptions.push(option); | ||
} | ||
else { | ||
localOptions.push(option); | ||
} | ||
} | ||
@@ -94,2 +101,5 @@ this.opts[name] = option; | ||
} | ||
// Inherited options should be processed before other options | ||
this.onProcessQueue.unshift(...inheritedOptions); | ||
this.onProcessQueue.push(...localOptions); | ||
return this; | ||
@@ -101,3 +111,3 @@ } | ||
if (this.shouldInheritOption(option)) { | ||
optionsToInherit.push(option); | ||
optionsToInherit.push(Object.assign(Object.assign({}, option), { inherited: true })); | ||
} | ||
@@ -104,0 +114,0 @@ } |
{ | ||
"name": "cilly", | ||
"version": "1.0.24", | ||
"version": "1.0.25", | ||
"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", |
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
78077
1203