File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22import { createDB } from "./index" ;
3- import { OPTION_TYPE_CHECKS } from "./constants" ;
3+ import { DEFAULT_OPTIONS_KEYS , OPTION_TYPE_CHECKS } from "./constants" ;
44import { ServerOptions } from "../types" ;
55
66async function main ( ) {
@@ -9,11 +9,17 @@ async function main() {
99 _DO_NOT_USE_cli : true
1010 }
1111 for ( const opt of definedOptions ) {
12+ if ( ! DEFAULT_OPTIONS_KEYS . includes ( opt ) ) {
13+ console . error ( `Option ${ opt } is not a valid option.` )
14+ return
15+ }
16+
1217 const index = process . argv . indexOf ( opt )
1318 const optionValue = process . argv [ index + 1 ]
1419
1520 if ( optionValue === undefined ) {
16- throw `Option ${ opt } must have a value.`
21+ console . error ( `Option ${ opt } must have a value.` )
22+ return
1723 }
1824
1925 const optionName = opt . slice ( 2 )
You can’t perform that action at this time.
0 commit comments