Skip to content

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

@sfeigl

Description

@sfeigl

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions