From a6e4b1d4870a1eb9800be17e3e150dc646cf28b0 Mon Sep 17 00:00:00 2001 From: Jaagrav Date: Thu, 10 Oct 2024 03:08:42 +0530 Subject: [PATCH 1/2] Fix support for additional arguments in DefaultCommand --- .../java/org/ballerinalang/command/cmd/DefaultCommand.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/ballerinalang/command/cmd/DefaultCommand.java b/src/main/java/org/ballerinalang/command/cmd/DefaultCommand.java index 351ff953..ed9f3e4b 100644 --- a/src/main/java/org/ballerinalang/command/cmd/DefaultCommand.java +++ b/src/main/java/org/ballerinalang/command/cmd/DefaultCommand.java @@ -20,6 +20,7 @@ import picocli.CommandLine; import java.io.PrintStream; +import java.util.List; /** * This class represents the "default" command required by picocli. @@ -37,12 +38,15 @@ public class DefaultCommand extends Command implements BCommand { @CommandLine.Option(names = { "--version", "-v" }, hidden = true) private boolean versionFlag; + @CommandLine.Parameters(description = "Help command name") + private List helpCommands; + public DefaultCommand(PrintStream printStream) { super(printStream); } @Override - public void execute() { + public void execute() { if (versionFlag) { printVersionInfo(); return; From dc23cbca3ba8536816874b5ddaabb2c0ee2460c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=86S?= Date: Thu, 24 Oct 2024 22:40:22 +0530 Subject: [PATCH 2/2] chore: remove extra space Co-authored-by: Gayal Dassanayake --- src/main/java/org/ballerinalang/command/cmd/DefaultCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/ballerinalang/command/cmd/DefaultCommand.java b/src/main/java/org/ballerinalang/command/cmd/DefaultCommand.java index ed9f3e4b..fcbbb191 100644 --- a/src/main/java/org/ballerinalang/command/cmd/DefaultCommand.java +++ b/src/main/java/org/ballerinalang/command/cmd/DefaultCommand.java @@ -46,7 +46,7 @@ public DefaultCommand(PrintStream printStream) { } @Override - public void execute() { + public void execute() { if (versionFlag) { printVersionInfo(); return;