You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/06/09 15:25:36 UTC

[camel] branch camel-3.20.x updated: camel-jbang - Fix watch mode and make some commands auto detect single running camel app

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-3.20.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-3.20.x by this push:
     new aa6c27791c7 camel-jbang - Fix watch mode and make some commands auto detect single running camel app
aa6c27791c7 is described below

commit aa6c27791c7d843e0137b90a0e84a1d8140596ed
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Jun 9 17:22:45 2023 +0200

    camel-jbang - Fix watch mode and make some commands auto detect single running camel app
---
 .../camel/dsl/jbang/core/commands/action/ActionWatchCommand.java      | 2 +-
 .../camel/dsl/jbang/core/commands/action/CamelSourceAction.java       | 4 ++--
 .../apache/camel/dsl/jbang/core/commands/action/CamelSourceTop.java   | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/ActionWatchCommand.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/ActionWatchCommand.java
index 165aa2d9c6f..0e979c4df96 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/ActionWatchCommand.java
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/ActionWatchCommand.java
@@ -36,7 +36,7 @@ abstract class ActionWatchCommand extends ActionBaseCommand {
         int exit;
         if (watch) {
             do {
-                exit = doCall();
+                exit = doWatchCall();
                 if (exit == 0) {
                     // use 2-sec delay in watch mode
                     Thread.sleep(2000);
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelSourceAction.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelSourceAction.java
index ecdd9d443db..0f6f7fd24f7 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelSourceAction.java
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelSourceAction.java
@@ -39,8 +39,8 @@ public class CamelSourceAction extends ActionBaseCommand {
 
     // TODO: strip license header
 
-    @CommandLine.Parameters(description = "Name or pid of running Camel integration", arity = "1")
-    String name;
+    @CommandLine.Parameters(description = "Name or pid of running Camel integration", arity = "0..1")
+    String name = "*";
 
     @CommandLine.Option(names = { "--filter" },
                         description = "Filter source by filename (multiple names can be separated by comma)")
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelSourceTop.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelSourceTop.java
index b6d584a4630..47c3461ab7a 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelSourceTop.java
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelSourceTop.java
@@ -35,8 +35,8 @@ import picocli.CommandLine.Command;
 @Command(name = "source", description = "List top processors (source) in a running Camel integration")
 public class CamelSourceTop extends ActionWatchCommand {
 
-    @CommandLine.Parameters(description = "Name or pid of running Camel integration", arity = "1")
-    String name;
+    @CommandLine.Parameters(description = "Name or pid of running Camel integration", arity = "0..1")
+    String name = "*";
 
     @CommandLine.Option(names = { "--limit" },
                         description = "Filter processors by limiting to the given number of rows")