File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
main/java/org/apache/jackrabbit/oak/run
test/java/org/apache/jackrabbit/oak/plugins/document Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,20 @@ public class RevisionsCommand implements Command {
105105 "org.apache.jackrabbit.oak.plugins.document.VersionGCRecommendations"
106106 );
107107
108+ private final boolean exitWhenDone ;
109+
110+ public RevisionsCommand () {
111+ this (true );
112+ }
113+
114+ /**
115+ *
116+ * @param exitWhenDone if true, the command will exit the JVM when done
117+ */
118+ public RevisionsCommand (boolean exitWhenDone ) {
119+ this .exitWhenDone = exitWhenDone ;
120+ }
121+
108122 private static class RevisionsOptions extends Utils .NodeStoreOptions {
109123
110124 static final String CMD_INFO = "info" ;
@@ -325,6 +339,10 @@ public void execute(String... args) throws Exception {
325339 } else {
326340 System .err .println ("unknown revisions command: " + subCmd );
327341 }
342+ if (exitWhenDone ) {
343+ System .out .printf ("Command '%s' completed successfully.%n" , subCmd );
344+ System .exit (0 );
345+ }
328346 } catch (Throwable e ) {
329347 LOG .error ("Command failed" , e );
330348 throw closer .rethrow (e );
Original file line number Diff line number Diff line change @@ -433,7 +433,7 @@ public RevisionsCmd(String... args) {
433433 @ Override
434434 public void run () {
435435 try {
436- new RevisionsCommand ().execute (args .toArray (new String [0 ]));
436+ new RevisionsCommand (false ).execute (args .toArray (new String [0 ]));
437437 } catch (Exception e ) {
438438 throw new RuntimeException (e );
439439 }
You can’t perform that action at this time.
0 commit comments