diff --git a/src/index.ts b/src/index.ts index 9b6e480..76aba42 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,11 +15,7 @@ const generateCommand = () => { .choices(['HTML', 'JSON', 'CSV']) .default('HTML') ) - .requiredOption( - '--excludes ', - 'exclude patterns is separated by a comma. example: .test.ts$,.spec.ts$', - '$^' - ) + .option('--excludes ', 'exclude patterns is separated by a comma. example: .test.ts$ .spec.ts$') .requiredOption('--matches ', 'match patterns. example: .ts$', '.*') .option( '-o, --outputReportPath ', @@ -32,7 +28,7 @@ Fo r HTML or CSV, specify the directory, and for JSON, specify the file.` const outputReportPath = options.outputReportPath ?? (options.outputFormat === 'JSON' ? null : './sabik_report'); const outputPath = outputReportPath !== null ? resolve(outputReportPath) : null; const analyzedTarget = resolve(targetPath ?? './'); - const excludes = (options.excludes).split(',').map((row) => new RegExp(row)); + const excludes = (options.excludes ?? ['$^']).map((row) => new RegExp(row)); const matches = new RegExp(options.matches); if (!fs.existsSync(analyzedTarget)) {