@@ -276,6 +276,7 @@ public static void main(String argv[]) {
276
276
277
277
} catch (ParseException e ) {
278
278
System .err .println ("** " +e .getMessage ());
279
+ System .exit (1 );
279
280
} catch (IndexerException ex ) {
280
281
LOGGER .log (Level .SEVERE , "Exception running indexer" , ex );
281
282
System .err .println (openGrok .getUsage ());
@@ -339,8 +340,8 @@ public static WebAddress parseWebAddress(String webAddr) {
339
340
public static String [] parseOptions (String [] argv ) throws ParseException {
340
341
String [] usage = { "--help" };
341
342
String program = "opengrok.jar" ;
342
- String [] onOff = {ON , OFF };
343
- String [] remoteRepoChoices = {ON , OFF , DIRBASED , UIONLY };
343
+ final String [] ON_OFF = {ON , OFF };
344
+ final String [] REMOTE_REPO_CHOICES = {ON , OFF , DIRBASED , UIONLY };
344
345
345
346
if (argv .length == 0 ) {
346
347
argv = usage ; // will force usage output
@@ -467,12 +468,12 @@ public static String[] parseOptions(String[] argv) throws ParseException {
467
468
cfg .getIgnoredNames ().add ((String )pattern );
468
469
});
469
470
470
- parser .on ("-l" , "--lock" , "=on/ off" , onOff , Boolean .class ,
471
- "Turn on/ off locking of the Lucene database during index generation." ).Do ( v -> {
471
+ parser .on ("-l" , "--lock" , "=on| off" , ON_OFF , Boolean .class ,
472
+ "Turn on| off locking of the Lucene database during index generation." ).Do ( v -> {
472
473
cfg .setUsingLuceneLocking ((Boolean )v );
473
474
});
474
475
475
- parser .on ("--leadingWildCards" , "=on/ off" , onOff , Boolean .class ,
476
+ parser .on ("--leadingWildCards" , "=on| off" , ON_OFF , Boolean .class ,
476
477
"Allow or disallow leading wildcards in a search." ).Do ( v -> {
477
478
cfg .setAllowLeadingWildcard ((Boolean )v );
478
479
});
@@ -510,7 +511,7 @@ public static String[] parseOptions(String[] argv) throws ParseException {
510
511
runIndex = false ;
511
512
});
512
513
513
- parser .on ("-O" , "--optimize" , "=on/ off" , onOff , Boolean .class ,
514
+ parser .on ("-O" , "--optimize" , "=on| off" , ON_OFF , Boolean .class ,
514
515
"Turn on/off the optimization of the index database" ,
515
516
"as part of the indexing step." ).
516
517
Do ( v -> {
@@ -560,7 +561,7 @@ public static String[] parseOptions(String[] argv) throws ParseException {
560
561
}
561
562
);
562
563
563
- parser .on ("-Q" , "--quickScan" , "=on/ off" , onOff , Boolean .class ,
564
+ parser .on ("-Q" , "--quickScan" , "=on| off" , ON_OFF , Boolean .class ,
564
565
"Turn on/off quick context scan. By default, only the first" ,
565
566
"1024k of a file is scanned, and a '[..all..]' link is inserted" ,
566
567
"when the file is bigger. Activating this may slow the server down." ,
@@ -578,7 +579,8 @@ public static String[] parseOptions(String[] argv) throws ParseException {
578
579
// Already handled above. This populates usage.
579
580
});
580
581
581
- parser .on ("-r" , "--remote" , "=on|off|uionly|dirbased" , remoteRepoChoices ,
582
+ parser .on ("-r" , "--remote" , "=on|off|uionly|dirbased" ,
583
+ REMOTE_REPO_CHOICES ,
582
584
"Specify support for remote SCM systems." ,
583
585
" on - allow retrieval for remote SCM systems." ,
584
586
" off - ignore SCM for remote systems." ,
@@ -599,7 +601,7 @@ public static String[] parseOptions(String[] argv) throws ParseException {
599
601
}
600
602
);
601
603
602
- parser .on ("--renamedHistory" , "=on/ off" , onOff , Boolean .class ,
604
+ parser .on ("--renamedHistory" , "=on| off" , ON_OFF , Boolean .class ,
603
605
"Enable or disable generating history for renamed files." ,
604
606
"If set to on, makes history indexing slower for repositories" ,
605
607
"with lots of renamed files." ).Do ( v -> {
0 commit comments