@nu-art/commando 0.204.15 → 0.204.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/cli-params.js +5 -1
- package/package.json +1 -1
package/cli/cli-params.js
CHANGED
|
@@ -44,7 +44,7 @@ class CLIParams_Resolver {
|
|
|
44
44
|
* @returns CliParamsObject
|
|
45
45
|
*/
|
|
46
46
|
resolveParamValue(inputParams = process.argv.slice(2, process.argv.length)) {
|
|
47
|
-
|
|
47
|
+
const runtimeParams = inputParams.reduce((output, inputParam) => {
|
|
48
48
|
var _a;
|
|
49
49
|
const cliParamToResolve = this.findMatchingParamToResolve(inputParam);
|
|
50
50
|
if (!cliParamToResolve)
|
|
@@ -72,6 +72,10 @@ class CLIParams_Resolver {
|
|
|
72
72
|
output[key] = finalValue;
|
|
73
73
|
return output;
|
|
74
74
|
}, {});
|
|
75
|
+
this.params.filter(param => (0, ts_common_1.exists)(param.defaultValue) && !(0, ts_common_1.exists)(runtimeParams[param.keyName])).forEach(param => {
|
|
76
|
+
runtimeParams[param.keyName] = param.defaultValue;
|
|
77
|
+
});
|
|
78
|
+
return runtimeParams;
|
|
75
79
|
}
|
|
76
80
|
/**
|
|
77
81
|
* Find the matching param by finding it's key in the current argument
|