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 2025/11/11 13:31:13 UTC
(camel) branch main updated: CAMEL-22684: camel-jbang doc command should not show headers by default. Also filter headers.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 2e15d8806985 CAMEL-22684: camel-jbang doc command should not show headers by default. Also filter headers.
2e15d8806985 is described below
commit 2e15d8806985ce8c7a05acd8da7be051dab4a853
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Nov 11 14:30:44 2025 +0100
CAMEL-22684: camel-jbang doc command should not show headers by default. Also filter headers.
---
.../camel/dsl/jbang/core/commands/catalog/CatalogDoc.java | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/catalog/CatalogDoc.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/catalog/CatalogDoc.java
index 41d76d4f76a2..3ea5c08cf29c 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/catalog/CatalogDoc.java
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/catalog/CatalogDoc.java
@@ -99,7 +99,7 @@ public class CatalogDoc extends CamelCommand {
String filter;
@CommandLine.Option(names = { "--header" },
- description = "Whether to display component message headers", defaultValue = "true")
+ description = "Whether to display component message headers", defaultValue = "false")
boolean headers;
@CommandLine.Option(names = {
@@ -433,9 +433,15 @@ public class CatalogDoc extends CamelCommand {
printer().println("");
if (headers && !cm.getEndpointHeaders().isEmpty()) {
- printer().printf("The %s component supports (total: %s) message headers, which are listed below.%n%n",
- cm.getName(), cm.getEndpointHeaders().size());
- printer().println(AsciiTable.getTable(AsciiTable.FANCY_ASCII, cm.getEndpointHeaders(), Arrays.asList(
+ filtered = filter(filter, cm.getEndpointHeaders());
+ total1 = cm.getEndpointHeaders().size();
+ total2 = filtered.size();
+ if (total1 == total2) {
+ printer().printf("Message headers (total: %s):%n", total1);
+ } else {
+ printer().printf("Message headers (total: %s match-filter: %s):%n", total1, total2);
+ }
+ printer().println(AsciiTable.getTable(AsciiTable.FANCY_ASCII, filtered, Arrays.asList(
new Column().header("NAME").dataAlign(HorizontalAlign.LEFT).minWidth(20)
.maxWidth(35, OverflowBehaviour.NEWLINE)
.with(this::getName),