diff --git a/src/parseSpecEntry.ts b/src/parseSpecEntry.ts index 2806925..03160ff 100644 --- a/src/parseSpecEntry.ts +++ b/src/parseSpecEntry.ts @@ -5,7 +5,7 @@ export default function parseSpecEntry({ outputArgs, requiredOptions, shortToLon if (longOption === '') { throw new Error(`The long option may not be an empty string. This is a bug in the source code of the script that you tried to call.`); } - if (!longOption.match(/^[a-z0-9]+(-[a-z0-9]+)*$/)) { + if (longOption.match(/^[a-z0-9]+(?:-[a-z0-9]+)*$/) === null) { throw new Error(`The long option "${longOption}" must only contain alpha-numeric characters, optionally separated by hyphens. This is a bug in the source code of the script that you tried to call.`); }