Skip to content

Commit 6f6ada3

Browse files
committed
Followup for #258: Fix forbiddenapis and only print error message if there are actually arguments given.
1 parent 7c32e88 commit 6f6ada3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/de/thetaphi/forbiddenapis/cli/CliMain.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ public CliMain(String... args) throws ExitException {
154154
throw new ExitException(EXIT_SUCCESS);
155155
}
156156
} catch (org.apache.commons.cli.ParseException pe) {
157-
System.out.println(pe.getMessage());
157+
if (args.length > 0) {
158+
StdIoLogger.INSTANCE.error(pe.getMessage());
159+
}
158160
printHelp(options);
159161
throw new ExitException(EXIT_ERR_CMDLINE);
160162
}

0 commit comments

Comments
 (0)