[ 
https://issues.apache.org/jira/browse/CAMEL-25696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18127861#comment-18127861
 ] 

Claus Ibsen commented on CAMEL-25696:
-------------------------------------

Pull request: https://github.com/apache/camel/pull/27951 — arity 0..1 with the 
fallback value true on all 82 boolean options that are on by default (core, 
kubernetes and validate plugins), so a bare flag turns the option on; 
--option=false still turns it off. A test walks the commands so a new option 
cannot bring the problem back. Upgrade guide entry for 4.24.

_Claude Code on behalf of davsclaus_

> camel-jbang - A boolean option that is on by default is turned off when given 
> without a value
> ---------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-25696
>                 URL: https://issues.apache.org/jira/browse/CAMEL-25696
>             Project: Camel
>          Issue Type: Sub-task
>          Components: camel-jbang
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Major
>             Fix For: 4.24.0
>
>
> picocli sets a boolean flag to the opposite of its default value when the 
> flag is given without a value. For the options of the Camel CLI that are on 
> by default, a bare flag therefore turns the option off: {{camel debug 
> --stop-on-exit}} does not stop the integration on exit, and {{camel export 
> --maven-wrapper}}, {{camel cmd receive --show-body}} or {{--logging-color}} 
> turn the option off. A script or an AI agent that writes the flag to be 
> explicit gets the opposite.
> 131 options are affected (the {{--download}}, {{--logging-color}}, 
> {{--show-*}}, {{--maven-*-enabled}}, {{--lazy-bean}}, {{--docker}} families 
> and more). CAMEL-25396 fixed {{--follow}} ({{log}}, {{trace}}, {{cmd 
> receive}}, {{infra log}}) and {{hawtio --open-url}} with {{arity = "0..1", 
> fallbackValue = "true"}}: a bare flag is true, {{--option=false}} still 
> works, and a following name or file is not taken as the value.
> Proposal:
> * Do the same for every boolean option whose default is true, per option or 
> once for the whole command tree.
> * A test that walks the command tree of {{CamelJBangMain}} and fails for a 
> default-true boolean flag without a fallback value, so new options do not 
> regress.
> * Upgrade guide: a bare flag turns the option on.
> _Claude Code on behalf of davsclaus (Claus Ibsen)_



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to