1616
1717package org .rundeck .client .tool .commands ;
1818
19- import com .fasterxml .jackson .databind .ObjectMapper ;
2019import lombok .Getter ;
2120import lombok .Setter ;
2221import okhttp3 .ResponseBody ;
4847 */
4948@ CommandLine .Command (name = "executions" , description = "List running executions, attach and follow their output, or kill them." )
5049public class Executions extends BaseCommand {
51-
52- private static final ObjectMapper JSON = new ObjectMapper ();
53-
5450 @ Getter
5551 @ Setter
5652 static class KillOptions extends ExecutionIdOption {
@@ -532,7 +528,7 @@ public boolean deleteall(@CommandLine.Mixin DeleteAllExecCmd options) throws IOE
532528
533529 // End Delete all executions.
534530
535- static interface HasJobIdList {
531+ interface HasJobIdList {
536532 List <String > getJobIdList ();
537533
538534 default boolean isJobIdList () {
@@ -568,7 +564,7 @@ public boolean isIdlist() {
568564
569565 @ CommandLine .Command (description = "Find and delete executions in a project. Use the query options to find and delete " +
570566 "executions, or specify executions with the `idlist` option." )
571- public boolean deletebulk (@ CommandLine .Mixin BulkDeleteCmd options ,
567+ public int deletebulk (@ CommandLine .Mixin BulkDeleteCmd options ,
572568 @ CommandLine .Mixin PagingResultOptions paging ,
573569 @ CommandLine .Mixin ExecutionOutputFormatOption outputFormatOption ) throws IOException , InputError {
574570
@@ -588,7 +584,7 @@ public boolean deletebulk(@CommandLine.Mixin BulkDeleteCmd options,
588584 } else {
589585 getRdOutput ().warning ("No executions found to delete" );
590586 }
591- return ! options .isRequire ();
587+ return options .isRequire ()? 2 : 0 ;
592588 }
593589 }
594590
@@ -598,7 +594,7 @@ public boolean deletebulk(@CommandLine.Mixin BulkDeleteCmd options,
598594
599595 if (!"y" .equals (s )) {
600596 getRdOutput ().warning ("Not deleting executions." );
601- return false ;
597+ return 1 ;
602598 }
603599 }
604600 final List <String > finalExecIds = execIds ;
@@ -613,7 +609,7 @@ public boolean deletebulk(@CommandLine.Mixin BulkDeleteCmd options,
613609 }else {
614610 getRdOutput ().info (String .format ("Deleted %d executions." , result .getSuccessCount ()));
615611 }
616- return result .isAllsuccessful ();
612+ return result .isAllsuccessful ()? 0 : 1 ;
617613 }
618614
619615 public static boolean maybeFollow (
@@ -651,7 +647,7 @@ public static boolean maybeFollow(
651647 /**
652648 * @param millis wait time
653649 *
654- * @return wait function which returns false if interrupted, true otherwise
650+ * @return wait function which returns false if interrupted true otherwise
655651 */
656652 private static BooleanSupplier waitUnlessInterrupt (final int millis ) {
657653 return () -> {
0 commit comments