File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -361,22 +361,24 @@ function parseOptions(args) {
361361 } ;
362362
363363 for ( let i = 0 ; i < args . length ; ++ i ) {
364- if ( Object . prototype . hasOwnProperty . call ( correspondences , args [ i ] ) ) {
364+ const arg = args [ i ] ;
365+ if ( Object . prototype . hasOwnProperty . call ( correspondences , arg ) ) {
365366 i += 1 ;
366367 if ( i >= args . length ) {
367- console . log ( "Missing argument after `" + args [ i - 1 ] + "` option." ) ;
368+ console . log ( "Missing argument after `" + arg + "` option." ) ;
368369 return null ;
369370 }
370- if ( args [ i - 1 ] !== "--test-file" ) {
371- opts [ correspondences [ args [ i - 1 ] ] ] = args [ i ] ;
371+ const arg_value = args [ i ] ;
372+ if ( arg !== "--test-file" ) {
373+ opts [ correspondences [ arg ] ] = arg_value ;
372374 } else {
373- opts [ correspondences [ args [ i - 1 ] ] ] . push ( args [ i ] ) ;
375+ opts [ correspondences [ arg ] ] . push ( arg_value ) ;
374376 }
375- } else if ( args [ i ] === "--help" ) {
377+ } else if ( arg === "--help" ) {
376378 showHelp ( ) ;
377379 process . exit ( 0 ) ;
378380 } else {
379- console . log ( "Unknown option `" + args [ i ] + "`." ) ;
381+ console . log ( "Unknown option `" + arg + "`." ) ;
380382 console . log ( "Use `--help` to see the list of options" ) ;
381383 return null ;
382384 }
You can’t perform that action at this time.
0 commit comments