Skip to content

Commit 62b82a8

Browse files
committed
Output --help to stdout not stderr, with EXIT STATUS=0
1 parent 293ff32 commit 62b82a8

File tree

1 file changed

+6
-6
lines changed
  • opengrok-indexer/src/main/java/org/opengrok/indexer/index

1 file changed

+6
-6
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/index/Indexer.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
import java.io.File;
2828
import java.io.IOException;
29+
import java.io.PrintStream;
2930
import java.lang.reflect.Field;
3031
import java.lang.reflect.InvocationTargetException;
3132
import java.net.URI;
@@ -145,12 +146,11 @@ public static void main(String[] argv) {
145146
try {
146147
argv = parseOptions(argv);
147148
if (help) {
148-
status = 1;
149-
System.err.println(helpUsage);
149+
PrintStream helpStream = status != 0 ? System.err : System.out;
150+
helpStream.println(helpUsage);
150151
if (helpDetailed) {
151-
System.err.println(AnalyzerGuruHelp.getUsage());
152-
System.err.println(
153-
ConfigurationHelp.getSamples());
152+
helpStream.println(AnalyzerGuruHelp.getUsage());
153+
helpStream.println(ConfigurationHelp.getSamples());
154154
}
155155
System.exit(status);
156156
}
@@ -414,7 +414,7 @@ public static String[] parseOptions(String[] argv) throws ParseException {
414414

415415
if (argv.length == 0) {
416416
argv = usage; // will force usage output
417-
status = 1;
417+
status = 1; // with non-zero EXIT STATUS
418418
}
419419

420420
/*

0 commit comments

Comments
 (0)