Claus Ibsen created CAMEL-27055:
-----------------------------------
Summary: camel-jbang - camel get and camel cmd create only the
sub-command that runs
Key: CAMEL-27055
URL: https://issues.apache.org/jira/browse/CAMEL-27055
Project: Camel
Issue Type: Improvement
Components: camel-jbang
Reporter: Claus Ibsen
Assignee: Claus Ibsen
Fix For: 4.24.0
{{camel get route}}, {{camel cmd reset-stats}} and the other sub-commands of a
command with many (get and cmd have about 40 each) cost 30-40 ms more than
{{camel ps}}: the CLI creates every sub-command of the group (loading their
classes, 14 ms with the CDS archive of camel.sh, 36 ms without), and aesh reads
the annotations of each of them, while the command line runs one.
Fix:
* {{CommandTree}} gives aesh only the sub-command that the command line names
({{camel get route}}: only {{route}}), at every level. With no arguments, an
option such as {{--help}}, or a name that is not a sub-command (aesh then
suggests the sub-commands), it gives all of them, as before.
* {{CommandTree.lazy(factory)}}: a tree whose command is created when it is
first needed. The sub-commands of the groups of the CLI are added this way, so
the ones that do not run are not created.
_Claude Code on behalf of Claus Ibsen_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)