🐛 Provide default value to reduce function

This commit is contained in:
C-3PO 2018-11-09 03:12:48 +01:00
parent 384fee4112
commit 8b75853569
Signed by: c3po
GPG key ID: 62993C4BB4D86F24

View file

@ -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.
//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
if (lastOption !== '') {