You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2026/10/16 15:37:00 UTC
[jira] [Resolved] (CAMEL-25696) camel-jbang - A boolean option that is on by default is turned off when given without a value
[ https://issues.apache.org/jira/browse/CAMEL-25696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-25696.
---------------------------------
Resolution: Fixed
Merged in https://github.com/apache/camel/pull/27951 (commit 16b6e9dfbe82) for 4.24.0: all 82 boolean options that are on by default take arity 0..1 with the fallback value true, so a bare flag turns the option on (--option=false still turns it off). Tests in camel-jbang-core and the kubernetes and validate plugins walk the commands so a new option cannot bring the problem back.
_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)