Claus Ibsen created CAMEL-26466:
-----------------------------------

             Summary: camel-jbang - The metadata and pages of the commands are 
generated from the command model, not from the source
                 Key: CAMEL-26466
                 URL: https://issues.apache.org/jira/browse/CAMEL-26466
             Project: Camel
          Issue Type: Improvement
          Components: camel-jbang
            Reporter: Claus Ibsen
            Assignee: Claus Ibsen
             Fix For: 4.24.0


The metadata of the CLI commands ({{camel-jbang-commands-metadata.json}}, which 
{{camel ask}} uses) and the command pages under {{jbang-commands/}} are 
generated by {{PrepareCamelJBangCommandsMojo}}. It reads the commands from the 
Java source: regular expressions over the {{addSubcommand}} chains of 
{{CamelJBangMain}} and of the plugins, Roaster for the picocli annotations, and 
reflection for the classes of a library.

Reading the source gets several things wrong in the docs today:
* a default value that is a constant is documented as its name, such as 
{{RuntimeType.SPRING_BOOT_VERSION}} instead of {{4.1.2}};
* quotes and {{+}} are removed from descriptions ("0=Created+Completed" becomes 
"0=Created Completed");
* an array option is documented as {{String}};
* a nested enum type can resolve to the wrong class;
* {{$\{COMPLETION-CANDIDATES\}}} is filled in from the wrong list ({{cmd 
receive --output}}), or not at all for a plugin option whose candidates are in 
camel-jbang-core.

It also ties the build to picocli. For the port to aesh (CAMEL-23810), the 
generator should read the command model the CLI runs: a class in 
camel-jbang-core turns the model into plain data, and the mojo writes the 
metadata from it. At the switch only that class changes, and the committed 
metadata and pages show any difference.

_Claude Code on behalf of davsclaus (Claus Ibsen)_




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to