CAMEL-23654: camel-jbang - group commands in --help output by categor…#24276
Conversation
…y for better navigation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
💡 Manual integration tests recommended:
All tested modules (6 modules)
|
davsclaus
left a comment
There was a problem hiding this comment.
Thanks for working on this, @sk-reddy17 — grouping the help output is a welcome UX improvement. The categorizations look well thought out and all 37 built-in commands are covered.
A couple of minor suggestions for robustness (not blockers):
-
Hidden-command filtering: The renderer iterates over all
subcommands()without checkingusageMessage().hidden(). The default picocli renderer filters hidden commands out. While there are no hidden top-level commands today, if a plugin registers one in the future it would unexpectedly appear in help. A one-line guard in both loops would future-proof this:if (sub.getCommandSpec().usageMessage().hidden()) continue;
-
Maintenance guardrail: The static
GROUPSmap needs manual updating when new commands are added. The "Other" fallback handles this gracefully at runtime, but a test asserting that no built-in commands fall into "Other" would catch drift early — so developers adding a new command get a test failure reminding them to update the map. -
Test coverage: The tests check group headers and a few key commands, but don't verify that all registered commands appear in the output. A count-based assertion would be a stronger safety net.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
The
camel --helpoutput lists 40+ commands in one flat alphabetical list,which is hard to scan. This groups them into categories (Running, Monitoring,
Actions, Development, Configuration, Catalog, AI) so it's easier to find what
you need.
Done with a small picocli
IHelpSectionRendererwired intoCamelJBangMain.Anything not mapped to a group falls into "Other", so no command gets dropped.
Fixes https://issues.apache.org/jira/browse/CAMEL-23654
Example
Commands:
Test plan
--helpcamel --helpby hand to confirm it looks right