diff --git a/src/index.ts b/src/index.ts index 64040b3..e02b1c0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 !== '') {