closing the printstream
@@ -178,6 +178,7 @@ public class Application implements ApplicationRunner {
}
if (argumentState.isInteractive) {
+ try (final PrintStream interactivePrintStream = new PrintStream(System.out)) {
final InteractiveReader interactiveReader;
final Console console = System.console();
@@ -188,8 +189,10 @@ public class Application implements ApplicationRunner {
interactiveReader = new ScannerInteractiveReader(System.in);
}
- final PrintStream interactivePrintStream = new PrintStream(System.out);
interactiveManager.interact(interactiveReader, interactivePrintStream);
+ } catch (final Exception e) {
+ throw e;
+ }
}
configurationManager.initialize(options);
