Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options get doubled in non validating arg group when used in MixIn #2341

Open
sfeigl opened this issue Oct 14, 2024 · 2 comments
Open

Options get doubled in non validating arg group when used in MixIn #2341

sfeigl opened this issue Oct 14, 2024 · 2 comments

Comments

@sfeigl
Copy link

sfeigl commented Oct 14, 2024

When using a non-validating ArgGroup in a MixIn, the options of the ArgGroup are doubled in the "Usage" line. When placing the ArgGroup directly in the command class, the options are not doubled. When using a validating ArgGroup the options are also not doubled - as expected. As far as I tested to problem only occurs when using non-validating ArgGroups in a MixIn

I am using the ArgGroup to put a heading above a set of options that are added by a loadable plugin. The intention is to make clear which option belongs to which plugin.

Example:

plugin1:
--option
--anotherOption
plugin2:
--yetAnotherOption

The this code to reproduce the problem:

Minimal reproducing example

Actual output of picocli:

Force help
Usage: Test [--double] [--double]
Heading
--double This option is doubled

What I expect:

Force help
Usage: Test [--double]
Heading
--double This option is doubled

@remkop
Copy link
Owner

remkop commented Oct 14, 2024

Thank you for raising this. Sounds like you have found a bug. I will look into it when I have some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@sfeigl @remkop and others