Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to suppress the output of catchSystemExit() #29

Open
SixFelix opened this issue Nov 2, 2022 · 0 comments
Open

Is it possible to suppress the output of catchSystemExit() #29

SixFelix opened this issue Nov 2, 2022 · 0 comments

Comments

@SixFelix
Copy link

SixFelix commented Nov 2, 2022

When I run this code:

for (File image : testImages) { String[] args = {"imageconvert", "-f", "JPEG", image.toString(), "src/test/resources/testoutput"}; try { int exitcode = catchSystemExit(() -> { Main.main(args); }); assertEquals(0, exitcode); } catch (Exception e) { }

it results in this output on the console:

com.github.stefanbirkner.systemlambda.SystemLambda$CheckExitCalled at com.github.stefanbirkner.systemlambda.SystemLambda$NoExitSecurityManager.checkExit(SystemLambda.java:1419) at java.lang.Runtime.exit(Runtime.java:107) at java.lang.System.exit(System.java:973) at imageprocessor.imageconvert.ImageConvert.endOfConvert(ImageConvert.java:435) at imageprocessor.imageconvert.ImageConvert.convert(ImageConvert.java:180) at imageprocessor.imageconvert.ImageConvertParameters.run(ImageConvertParameters.java:71) at picocli.CommandLine.executeUserObject(CommandLine.java:1939) at picocli.CommandLine.access$1300(CommandLine.java:145) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358) at picocli.CommandLine$RunLast.handle(CommandLine.java:2352) at picocli.CommandLine$RunLast.handle(CommandLine.java:2314) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179) at picocli.CommandLine$RunLast.execute(CommandLine.java:2316) at picocli.CommandLine.execute(CommandLine.java:2078) at imageprocessor.Main.main(Main.java:10) ...

Is it possible to suppress this output?

Main.main(args) calls a picocli subcommand.

@SixFelix SixFelix changed the title Is it possible to limit the output of catchSystemExit() Is it possible to suppress the output of catchSystemExit() Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant