Skip to content

Commit 0b6f597

Browse files
change throws to console.error in cli
1 parent 33c7689 commit 0b6f597

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cli.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ async function main() {
1010
}
1111
for (const opt of definedOptions) {
1212
if (!DEFAULT_OPTIONS_KEYS.includes(opt)) {
13-
throw `Option ${opt} is not a valid option.`
13+
console.error(`Option ${opt} is not a valid option.`)
14+
return
1415
}
1516

1617
const index = process.argv.indexOf(opt)
1718
const optionValue = process.argv[index + 1]
1819

1920
if (optionValue === undefined) {
20-
throw `Option ${opt} must have a value.`
21+
console.error(`Option ${opt} must have a value.`)
22+
return
2123
}
2224

2325
const optionName = opt.slice(2)

0 commit comments

Comments
 (0)