Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
import picocli.AutoComplete;
import picocli.CommandLine;

@CommandLine.Command(name = "complete", description = "Generate completion script for bash/zsh")
@CommandLine.Command(name = "complete", description = "Generate completion script for bash/zsh",
footer = {
"%nExamples:",
" source <(camel completion)" })
public class Complete extends CamelCommand {

public Complete(CamelJBangMain main) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@
import static org.apache.camel.dsl.jbang.core.common.CommandLineHelper.CAMEL_JBANG_WORK_DIR;
import static org.apache.camel.util.IOHelper.buffered;

@Command(name = "debug", description = "Debug local Camel integration", sortOptions = false, showDefaultValues = true)
@Command(name = "debug", description = "Debug local Camel integration", sortOptions = false, showDefaultValues = true,
footer = {
"%nExamples:",
" camel debug hello.java",
" camel debug hello.yaml --breakpoint=myBreakpoint",
" camel debug hello.java --stop-on-exit=false" })
public class Debug extends Run {

@CommandLine.Option(names = { "--remote-attach" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@

@CommandLine.Command(name = "list",
description = "Displays all Camel dependencies required to run", sortOptions = false,
showDefaultValues = true)
showDefaultValues = true,
footer = {
"%nExamples:",
" camel dependency list hello.java",
" camel dependency list hello.java --output=gav" })
public class DependencyList extends Export {

protected static final String EXPORT_DIR = CommandLineHelper.CAMEL_JBANG_WORK_DIR + "/export";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@
*/
@Command(name = "explain",
description = "Explain what a Camel route does using AI/LLM",
sortOptions = false, showDefaultValues = true)
sortOptions = false, showDefaultValues = true,
footer = {
"%nExamples:",
" camel explain hello.java",
" camel explain hello.yaml --format=markdown",
" camel explain hello.java --model=gpt-4" })
public class Explain extends CamelCommand {

public static class FormatCompletionCandidates implements Iterable<String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,14 @@

@Command(name = "export",
description = "Export to other runtimes (Camel Main, Spring Boot, or Quarkus)", sortOptions = false,
showDefaultValues = true)
showDefaultValues = true,
footer = {
"%nExamples:",
" camel export hello.java",
" camel export --runtime=spring-boot hello.java",
" camel export --runtime=quarkus *",
" camel export --gav=com.example:myapp:1.0 hello.java",
" camel export --dry-run hello.java" })
public class Export extends ExportBaseCommand {

public Export(CamelJBangMain main) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@
*/
@Command(name = "harden",
description = "Suggest security hardening for Camel routes using AI/LLM",
sortOptions = false, showDefaultValues = true)
sortOptions = false, showDefaultValues = true,
footer = {
"%nExamples:",
" camel harden hello.java",
" camel harden hello.yaml --format=markdown",
" camel harden hello.java --model=gpt-4" })
public class Harden extends CamelCommand {

public static class FormatCompletionCandidates implements Iterable<String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@
import static org.apache.camel.dsl.jbang.core.common.GitHubHelper.fetchGithubUrls;

@Command(name = "init", description = "Creates a new Camel integration",
sortOptions = false, showDefaultValues = true)
sortOptions = false, showDefaultValues = true,
footer = {
"%nExamples:",
" camel init hello.java",
" camel init hello.yaml",
" camel init hello.xml",
" camel init --list" })
public class Init extends CamelCommand {

@Parameters(description = "Name of integration file (or a github link)", arity = "0..1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,15 @@
import static org.apache.camel.dsl.jbang.core.common.GitHubHelper.asGithubSingleUrl;
import static org.apache.camel.dsl.jbang.core.common.GitHubHelper.fetchGithubUrls;

@Command(name = "run", description = "Run as local Camel integration", sortOptions = false, showDefaultValues = true)
@Command(name = "run", description = "Run as local Camel integration", sortOptions = false, showDefaultValues = true,
footer = {
"%nExamples:",
" camel run hello.java",
" camel run hello.yaml",
" camel run *",
" camel run hello.java --dev",
" camel run hello.java --port=8080",
" camel run https://gist.github.com/user/123456" })
public class Run extends CamelCommand {

// special template for running camel-jbang in docker containers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@

@CommandLine.Command(name = "sbom",
description = "Generate a CycloneDX or SPDX SBOM for a specific project", sortOptions = false,
showDefaultValues = true)
showDefaultValues = true,
footer = {
"%nExamples:",
" camel sbom hello.java",
" camel sbom hello.java --sbom-format=spdx",
" camel sbom hello.java --sbom-output-format=xml" })
public class SBOMGenerator extends Export {

protected static final String EXPORT_DIR = CommandLineHelper.CAMEL_JBANG_WORK_DIR + "/export";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
import picocli.CommandLine;

@CommandLine.Command(name = "script", description = "Run Camel integration as shell script for terminal scripting",
sortOptions = false, showDefaultValues = true)
sortOptions = false, showDefaultValues = true,
footer = {
"%nExamples:",
" camel script hello.java",
" camel script hello.java --max-messages=10" })
public class Script extends CamelCommand {

@CommandLine.Parameters(description = "Name of file", arity = "1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@

@CommandLine.Command(name = "shell",
description = "Interactive Camel JBang shell.",
footer = "Press Ctrl-C to exit.")
footer = {
"%nExamples:",
" camel shell",
"",
"Press Ctrl-C to exit." })
public class Shell extends CamelCommand {

public Shell(CamelJBangMain main) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@
import picocli.CommandLine.Command;

@Command(name = "route", description = "Transform Camel routes to XML or YAML format", sortOptions = false,
showDefaultValues = true)
showDefaultValues = true,
footer = {
"%nExamples:",
" camel transform route hello.java --format=yaml",
" camel transform route hello.xml --format=yaml" })
public class TransformRoute extends CamelCommand {

public static class FormatCompletionCandidates implements Iterable<String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
import picocli.CommandLine.Command;

@Command(name = "wrapper", description = "Install Camel wrapper scripts for version pinning", sortOptions = false,
showDefaultValues = true)
showDefaultValues = true,
footer = {
"%nExamples:",
" camel wrapper",
" camel wrapper --camel-version=4.10.0" })
public class WrapperCommand extends CamelCommand {

private static final String DEFAULT_REPO_URL = "https://repo1.maven.org/maven2";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@
import picocli.CommandLine;

@CommandLine.Command(name = "log",
description = "Tail logs from running Camel integrations", sortOptions = false, showDefaultValues = true)
description = "Tail logs from running Camel integrations", sortOptions = false, showDefaultValues = true,
footer = {
"%nExamples:",
" camel log hello",
" camel log *",
" camel log hello --tail=50" })
public class CamelLogAction extends ActionBaseCommand {

private static final int NAME_MAX_WIDTH = 25;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@

@CommandLine.Command(name = "send",
description = "Send messages to endpoints", sortOptions = false,
showDefaultValues = true)
showDefaultValues = true,
footer = {
"%nExamples:",
" camel cmd send --endpoint=kafka:myTopic --body='Hello World'",
" camel cmd send hello --endpoint=direct:foo --body='Hello'" })
public class CamelSendAction extends ActionBaseCommand {

@CommandLine.Parameters(description = "To use an existing running Camel integration for sending the message (name or pid)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@

@CommandLine.Command(name = "trace",
description = "Tail message traces from running Camel integrations", sortOptions = false,
showDefaultValues = true)
showDefaultValues = true,
footer = {
"%nExamples:",
" camel trace hello",
" camel trace *" })
public class CamelTraceAction extends ActionBaseCommand {

private static final int NAME_MAX_WIDTH = 25;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
import picocli.CommandLine;

@CommandLine.Command(name = "component",
description = "List components from the Camel Catalog", sortOptions = false, showDefaultValues = true)
description = "List components from the Camel Catalog", sortOptions = false, showDefaultValues = true,
footer = {
"%nExamples:",
" camel catalog component",
" camel catalog component --filter=kafka" })
public class CatalogComponent extends CatalogBaseCommand {

public CatalogComponent(CamelJBangMain main) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@

@CommandLine.Command(name = "doc",
description = "Shows documentation for kamelet, component, and other Camel resources", sortOptions = false,
showDefaultValues = true)
showDefaultValues = true,
footer = {
"%nExamples:",
" camel doc kafka",
" camel doc timer",
" camel doc aws-s3-source",
" camel doc jsonpath" })
public class CatalogDoc extends CamelCommand {

@CommandLine.Parameters(description = "Name of kamelet, component, dataformat, or other Camel resource",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@
import picocli.CommandLine;

@CommandLine.Command(name = "kamelet",
description = "List Kamelets from the Kamelet Catalog", sortOptions = false, showDefaultValues = true)
description = "List Kamelets from the Kamelet Catalog", sortOptions = false, showDefaultValues = true,
footer = {
"%nExamples:",
" camel catalog kamelet",
" camel catalog kamelet --type=source",
" camel catalog kamelet --filter=kafka" })
public class CatalogKamelet extends CamelCommand {

@CommandLine.Option(names = { "--sort" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
import picocli.CommandLine;

@CommandLine.Command(name = "get",
description = "Display user configuration value", sortOptions = false, showDefaultValues = true)
description = "Display user configuration value", sortOptions = false, showDefaultValues = true,
footer = {
"%nExamples:",
" camel config get camel-version",
" camel config get runtime" })
public class ConfigGet extends CamelCommand {

@CommandLine.Parameters(description = "Configuration key", arity = "1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
import picocli.CommandLine;

@CommandLine.Command(name = "set",
description = "Set user configuration value", sortOptions = false, showDefaultValues = true)
description = "Set user configuration value", sortOptions = false, showDefaultValues = true,
footer = {
"%nExamples:",
" camel config set camel-version=4.10.0",
" camel config set runtime=spring-boot" })
public class ConfigSet extends CamelCommand {

@CommandLine.Parameters(description = "Configuration parameter (ex. key=value)", arity = "1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@
import picocli.CommandLine.Command;

@Command(name = "route", description = "Get status of Camel routes",
sortOptions = false, showDefaultValues = true)
sortOptions = false, showDefaultValues = true,
footer = {
"%nExamples:",
" camel get route",
" camel get route hello",
" camel get route --watch" })
public class CamelRouteStatus extends ProcessWatchCommand {

@CommandLine.Parameters(description = "Name or pid of running Camel integration", arity = "0..1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@

@CommandLine.Command(name = "get",
description = "Get status of Camel integrations (use get --help to see sub commands)",
sortOptions = false, showDefaultValues = true)
sortOptions = false, showDefaultValues = true,
footer = {
"%nExamples:",
" camel get",
" camel get route",
" camel get health",
" camel get endpoint" })
public class CamelStatus extends CamelCommand {

@CommandLine.Option(names = { "--watch" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@

@CommandLine.Command(name = "top",
description = "Top status of Camel integrations (use top --help to see sub commands)",
sortOptions = false, showDefaultValues = true)
sortOptions = false, showDefaultValues = true,
footer = {
"%nExamples:",
" camel top",
" camel top route",
" camel top processor" })
public class CamelTop extends CamelCommand {

@CommandLine.Option(names = { "--watch" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@
import picocli.CommandLine.Command;

@Command(name = "health", description = "Get health check status of running Camel integrations", sortOptions = false,
showDefaultValues = true)
showDefaultValues = true,
footer = {
"%nExamples:",
" camel get health",
" camel get health --watch" })
public class ListHealth extends ProcessWatchCommand {

@CommandLine.Option(names = { "--sort" }, completionCandidates = PidNameAgeCompletionCandidates.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@

import static org.apache.camel.dsl.jbang.core.common.CamelCommandHelper.extractState;

@Command(name = "ps", description = "List running Camel integrations", sortOptions = false, showDefaultValues = true)
@Command(name = "ps", description = "List running Camel integrations", sortOptions = false, showDefaultValues = true,
footer = {
"%nExamples:",
" camel ps",
" camel ps --sort=name",
" camel ps --watch" })
public class ListProcess extends ProcessWatchCommand {

@CommandLine.Option(names = { "--sort" }, completionCandidates = PidNameAgeCompletionCandidates.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@
import picocli.CommandLine;
import picocli.CommandLine.Command;

@Command(name = "stop", description = "Shuts down running Camel integrations", sortOptions = false, showDefaultValues = true)
@Command(name = "stop", description = "Shuts down running Camel integrations", sortOptions = false, showDefaultValues = true,
footer = {
"%nExamples:",
" camel stop hello",
" camel stop *",
" camel stop 12345",
" camel stop hello --kill" })
public class StopProcess extends ProcessBaseCommand {

@CommandLine.Parameters(description = "Name or pid of running Camel integration(s)", arity = "0..1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@
import static org.apache.camel.dsl.jbang.core.common.CamelCommandHelper.CAMEL_INSTANCE_TYPE;

@CommandLine.Command(name = "list", description = "Displays available Camel versions",
sortOptions = false, showDefaultValues = true)
sortOptions = false, showDefaultValues = true,
footer = {
"%nExamples:",
" camel version list",
" camel version list --runtime=spring-boot",
" camel version list --lts" })
public class VersionList extends CamelCommand {

private static final String VERSION_LIST_CHECKER = ".camel-jbang-version-list.json";
Expand Down
Loading
Loading