🐛 Provide default value to reduce function
This commit is contained in:
parent
384fee4112
commit
8b75853569
1 changed files with 1 additions and 1 deletions
|
@ -20,7 +20,7 @@ export default function parseArguments(
|
||||||
|
|
||||||
//Iterate through all command line arguments. When we have read both name and value, verify the argument for correctness.
|
//Iterate through all command line arguments. When we have read both name and value, verify the argument for correctness.
|
||||||
//Show error if a name has no value afterwards, or a value has no name in front of it.
|
//Show error if a name has no value afterwards, or a value has no name in front of it.
|
||||||
const lastOption = args.reduce(parseArgument.bind(null, { spec, outputArgs, requiredOptions, shortToLongLookup }));
|
const lastOption = args.reduce(parseArgument.bind(null, { spec, outputArgs, requiredOptions, shortToLongLookup }), '');
|
||||||
|
|
||||||
// argumentName must be cleared to '' after the value is read, so if it is not an empty string, the value was missing
|
// argumentName must be cleared to '' after the value is read, so if it is not an empty string, the value was missing
|
||||||
if (lastOption !== '') {
|
if (lastOption !== '') {
|
||||||
|
|
Loading…
Reference in a new issue