@@ -250,7 +250,7 @@ public static void main(String[] argv) {
250
250
IndexVersion .check (subFilesList );
251
251
} catch (IndexVersionException e ) {
252
252
System .err .printf ("Index version check failed: %s\n " , e );
253
- System .err .printf ("You might want to remove " +
253
+ System .err .print ("You might want to remove " +
254
254
(subFilesList .size () > 0 ?
255
255
"data for projects " + String .join ("," , subFilesList ) : "all data" ) +
256
256
" under the DATA_ROOT and to reindex\n " );
@@ -407,17 +407,16 @@ public static String[] parseOptions(String[] argv) throws ParseException {
407
407
boolean preHelp = Arrays .stream (argv ).anyMatch (s -> HELP_OPT_1 .equals (s ) ||
408
408
HELP_OPT_2 .equals (s ) || HELP_OPT_3 .equals (s ));
409
409
410
- OptionParser configure = OptionParser .scan (parser -> {
411
- parser .on ("-R configPath" ).Do (cfgFile -> {
412
- try {
413
- if (!preHelp ) {
414
- cfg = Configuration .read (new File ((String ) cfgFile ));
415
- }
416
- } catch (IOException e ) {
417
- die (e .getMessage ());
410
+ OptionParser configure = OptionParser .scan (parser ->
411
+ parser .on ("-R configPath" ).Do (cfgFile -> {
412
+ try {
413
+ if (!preHelp ) {
414
+ cfg = Configuration .read (new File ((String ) cfgFile ));
418
415
}
419
- });
420
- });
416
+ } catch (IOException e ) {
417
+ die (e .getMessage ());
418
+ }
419
+ }));
421
420
422
421
searchPaths .clear ();
423
422
@@ -450,9 +449,9 @@ public static String[] parseOptions(String[] argv) throws ParseException {
450
449
"/(\\ .\\ w+|\\ w+\\ .):(-|[a-zA-Z_0-9.]+)/" ,
451
450
"Associates files with the specified prefix or extension (case-" ,
452
451
"insensitive) to be analyzed with the given analyzer, where 'analyzer'" ,
453
- "may be specified using a simple class name (case-sensitive e.g." ,
454
- "RubyAnalyzer) or language name (case-sensitive e.g. C) prefix . Option" ,
455
- "may be repeated." ,
452
+ "may be specified using a class name (case-sensitive e.g. RubyAnalyzer) " ,
453
+ "or analyzer language name (case-sensitive e.g. C). Option may be " ,
454
+ "repeated." ,
456
455
" Ex: -A .foo:CAnalyzer" ,
457
456
" will use the C analyzer for all files ending with .FOO" ,
458
457
" Ex: -A bar.:Perl" ,
@@ -469,9 +468,8 @@ public static String[] parseOptions(String[] argv) throws ParseException {
469
468
);
470
469
471
470
parser .on ("-c" , "--ctags" , "=/path/to/ctags" ,
472
- "Path to Universal Ctags. Default is ctags in PATH." ).Do (ctagsPath ->
473
- cfg .setCtags ((String ) ctagsPath )
474
- );
471
+ "Path to Universal Ctags. Default is ctags in environment PATH." ).Do (
472
+ v -> cfg .setCtags ((String ) v ));
475
473
476
474
parser .on ("--canonicalRoot" , "=/path/" ,
477
475
"Allow symlinks to canonical targets starting with the specified root" ,
@@ -487,9 +485,8 @@ public static String[] parseOptions(String[] argv) throws ParseException {
487
485
});
488
486
489
487
parser .on ("--checkIndexVersion" ,
490
- "Check if current Lucene version matches index version." ).Do (v -> {
491
- checkIndexVersion = true ;
492
- });
488
+ "Check if current Lucene version matches index version." ).Do (v ->
489
+ checkIndexVersion = true );
493
490
494
491
parser .on ("-d" , "--dataRoot" , "=/path/to/data/root" ,
495
492
"The directory where OpenGrok stores the generated data." ).
@@ -511,9 +508,8 @@ public static String[] parseOptions(String[] argv) throws ParseException {
511
508
512
509
parser .on ("--depth" , "=number" , Integer .class ,
513
510
"Scanning depth for repositories in directory structure relative to" ,
514
- "source root. Default is " + Configuration .defaultScanningDepth + "." ).Do (depth -> {
515
- cfg .setScanningDepth ((Integer ) depth );
516
- });
511
+ "source root. Default is " + Configuration .defaultScanningDepth + "." ).Do (depth ->
512
+ cfg .setScanningDepth ((Integer ) depth ));
517
513
518
514
parser .on ("--disableRepository" , "=type_name" ,
519
515
"Disables operation of an OpenGrok-supported repository. See also" ,
@@ -537,13 +533,10 @@ public static String[] parseOptions(String[] argv) throws ParseException {
537
533
"be slightly slow." ).Do (v -> cfg .setGenerateHtml (false ));
538
534
539
535
parser .on ("-G" , "--assignTags" ,
540
- "Assign commit tags to all entries in history for all repositories." ).Do (v -> {
541
- cfg .setTagsEnabled (true );
542
- });
536
+ "Assign commit tags to all entries in history for all repositories." ).Do (v ->
537
+ cfg .setTagsEnabled (true ));
543
538
544
- parser .on ("-H" , "--history" , "Enable history." ).Do (v -> {
545
- cfg .setHistoryEnabled (true );
546
- });
539
+ parser .on ("-H" , "--history" , "Enable history." ).Do (v -> cfg .setHistoryEnabled (true ));
547
540
548
541
parser .on ("-I" , "--include" , "=pattern" ,
549
542
"Only files matching this pattern will be examined. Pattern supports" ,
@@ -571,9 +564,8 @@ public static String[] parseOptions(String[] argv) throws ParseException {
571
564
});
572
565
573
566
parser .on ("--leadingWildCards" , "=on|off" , ON_OFF , Boolean .class ,
574
- "Allow or disallow leading wildcards in a search. Default is on." ).Do (v -> {
575
- cfg .setAllowLeadingWildcard ((Boolean ) v );
576
- });
567
+ "Allow or disallow leading wildcards in a search. Default is on." ).Do (v ->
568
+ cfg .setAllowLeadingWildcard ((Boolean ) v ));
577
569
578
570
parser .on ("-m" , "--memory" , "=number" , Double .class ,
579
571
"Amount of memory (MB) that may be used for buffering added documents and" ,
@@ -661,9 +653,8 @@ public static String[] parseOptions(String[] argv) throws ParseException {
661
653
cfg .setQuickContextScan ((Boolean ) v ));
662
654
663
655
parser .on ("-q" , "--quiet" ,
664
- "Run as quietly as possible. Sets logging level to WARNING." ).Do (v -> {
665
- LoggerUtil .setBaseConsoleLogLevel (Level .WARNING );
666
- });
656
+ "Run as quietly as possible. Sets logging level to WARNING." ).Do (v ->
657
+ LoggerUtil .setBaseConsoleLogLevel (Level .WARNING ));
667
658
668
659
parser .on ("-R /path/to/configuration" ,
669
660
"Read configuration from the specified file." ).Do (v -> {
@@ -821,7 +812,7 @@ private static void checkConfiguration() {
821
812
}
822
813
823
814
if (repositories .size () > 0 && !cfg .isHistoryEnabled ()) {
824
- die ("Repositories were specified; however history is off" );
815
+ die ("Repositories were specified; history is off however " );
825
816
}
826
817
}
827
818
@@ -988,7 +979,7 @@ public void prepareIndexer(RuntimeEnvironment env,
988
979
// Even if history is disabled globally, it can be enabled for some repositories.
989
980
if (repositories != null && !repositories .isEmpty ()) {
990
981
LOGGER .log (Level .INFO , "Generating history cache for repositories: " +
991
- repositories . stream (). collect ( Collectors . joining ( "," ) ));
982
+ String . join ( "," , repositories ));
992
983
HistoryGuru .getInstance ().createCache (repositories );
993
984
LOGGER .info ("Done..." );
994
985
} else {
0 commit comments