Renamed doDoMain -> doMainNoExit.
This commit is contained in:
@@ -148,14 +148,14 @@ public abstract class CLICompiler<A extends CompilerArguments> {
|
|||||||
* Useful main for derived command line tools
|
* Useful main for derived command line tools
|
||||||
*/
|
*/
|
||||||
public static void doMain(@NotNull CLICompiler compiler, @NotNull String[] args) {
|
public static void doMain(@NotNull CLICompiler compiler, @NotNull String[] args) {
|
||||||
ExitCode exitCode = doDoMain(compiler, args);
|
ExitCode exitCode = doMainNoExit(compiler, args);
|
||||||
if (exitCode != OK) {
|
if (exitCode != OK) {
|
||||||
System.exit(exitCode.getCode());
|
System.exit(exitCode.getCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static ExitCode doDoMain(@NotNull CLICompiler compiler, @NotNull String[] args) {
|
public static ExitCode doMainNoExit(@NotNull CLICompiler compiler, @NotNull String[] args) {
|
||||||
try {
|
try {
|
||||||
ExitCode rc = compiler.exec(System.out, args);
|
ExitCode rc = compiler.exec(System.out, args);
|
||||||
if (rc != OK) {
|
if (rc != OK) {
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class CliTest {
|
|||||||
PrintStream origOut = System.out;
|
PrintStream origOut = System.out;
|
||||||
try {
|
try {
|
||||||
System.setOut(new PrintStream(bytes));
|
System.setOut(new PrintStream(bytes));
|
||||||
ExitCode exitCode = CLICompiler.doDoMain(new K2JVMCompiler(), args);
|
ExitCode exitCode = CLICompiler.doMainNoExit(new K2JVMCompiler(), args);
|
||||||
return bytes.toString("utf-8") + exitCode + "\n";
|
return bytes.toString("utf-8") + exitCode + "\n";
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user