Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f9249f1 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Flush output buffers when command is complete" into main am: d3485542

parents b2d981f5 d3485542
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -58,15 +58,23 @@ public abstract class BaseCommand {
        mRawArgs = args;
        mArgs.init(null, null, null, null, args, 0);

        int status = 1;
        try {
            onRun();
            status = 0;
        } catch (IllegalArgumentException e) {
            onShowUsage(System.err);
            System.err.println();
            System.err.println("Error: " + e.getMessage());
            status = 0;
        } catch (Exception e) {
            e.printStackTrace(System.err);
            System.exit(1);
        } finally {
            System.out.flush();
            System.err.flush();
        }
        if (status != 0) {
            System.exit(status);
        }
    }