diff --git a/src/cli.ts b/src/cli.ts index 8d3682b..ae54db5 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -22,7 +22,10 @@ import { Generator } from './generator'; const args = argv.filter(a => !a.startsWith('--')); const options: { [key: string]: string[] } = {}; for (const token of argv.filter(a => a.startsWith('--'))) { - const [, name, value] = token.match(/--([^=]+)(?:=(.*))?/)!; + const match = token.match(/--([^=]+)(?:=(.*))?/); + if (!match) + continue; + const [, name, value] = match; const oldValue = options[name]; if (oldValue) oldValue.push(value);