When the @TopLevelCommand has ..., helpCommand = true, ... set on annotation @CommandLine.Command, the sub-commands are displayed on the --help menu, but not executable.
git clone https://github.com/turing85/quarkus-picocli-subcommands.git
cd quarkus-picocli-subcommands
Build the application:
./mvnw clean package
Run the --help subcommand, observe that the bar subcommand is present:
java -jar target/quarkus-app/quarkus-run.jar --help
...
Usage: <main class> [-hV] [COMMAND]
-h, --help Show this help message and exit.
-V, --version Print version information and exit.
Commands:
bar
...
Try running the bar subcommand, observe that the @TopLevelCommand (FooCommand) is executed instead:
java -jar target/quarkus-app/quarkus-run.jar bar --name=baz
...
2024-07-29 13:10:10,401 INFO [de.tur.qua.pic.sub.FooCommand] (main) Hello from foo!
...
Apply the following patch, which removes the helpCommand = true from the @TopLevelCommand (FooCommand):
Rebuild the application, rerun the bar subcommand, observe that it works:
./mvnw clean package && java -jar target/quarkus-app/quarkus-run.jar bar --name=baz
...
2024-07-29 13:15:38,790 INFO [de.tur.qua.pic.sub.BarCommand] (main) Hello from Bar to baz!
...
Output of uname -a or ver
Linux xxx 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Output of java -version
openjdk version "21.0.3" 2024-04-16 LTS
OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (build 21.0.3+9-LTS, mixed mode, sharing)
Quarkus version or git rev
a least 3.8.5+
Build tool (ie. output of mvnw --version or gradlew --version)
Describe the bug
When the
@TopLevelCommand
has..., helpCommand = true, ...
set on annotation@CommandLine.Command
, the sub-commands are displayed on the--help
menu, but not executable.Expected behavior
Subcommands are executable.
Actual behavior
Subcommands ar enot executable.
How to Reproduce?
https://github.com/turing85/quarkus-picocli-subcommands
:--help
subcommand, observe that thebar
subcommand is present:bar
subcommand, observe that the@TopLevelCommand
(FooCommand
) is executed instead:Apply the following patch, which removes the
helpCommand = true
from the@TopLevelCommand
(FooCommand
):bar
subcommand, observe that it works:Output of
uname -a
orver
Output of
java -version
Quarkus version or git rev
a least
3.8.5+
Build tool (ie. output of
mvnw --version
orgradlew --version
)Additional information
No response