davsclaus opened a new pull request, #29934:
URL: https://github.com/apache/camel/pull/29934

   Part of item 4 of 
[CAMEL-26929](https://issues.apache.org/jira/browse/CAMEL-26929): options that 
are silently ignored.
   
   ## Problem
   
   `camel cmd route-structure --json` ignored `--filter`, `--sort`, `--brief` 
and `--description`: the JSON had every route of the dump, in the order of the 
dump, with the full code, and a route that is in the dump twice was in it 
twice. A filter that matched no route exited 0, with all the routes in the 
JSON. The text output handled all of them, and so does `camel cmd route-dump 
--json`.
   
   ## Change
   
   The routes are picked (once each, by `--filter`), sorted (`--sort`) and 
their code shortened (`--brief`, `--description`) once, and then printed as 
JSON or as text, as `route-dump` does. The JSON keeps its shape: the object 
with `routes`, and `unread` for the parts of a Java route the parser could not 
read. A filter that matches no route is "No route matching: <filter>" with exit 
3, also with `--json`.
   
   The AI tools (`route_structure`, and the others that read the structure) 
call the console directly and are not changed.
   
   The 4.24 upgrade guide has a line in the exit codes entry, as a script could 
see the change.
   
   ## Tests
   
   - `CamelRouteStructureActionTest` (4 new, against a fake integration with 
two routes, one of them twice): `--json --filter`, `--json --sort=name|id` with 
each route once, `--json --brief` and `--json --description`, and `--json 
--filter=nope` exits 3 and prints no JSON. All 4 fail without the change.
   - camel-jbang-run: 303 pass. camel-jbang-core: 3006 + 259 pass.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to