Skip to content

Force parameters to follow options #2103

@ddsharpe

Description

@ddsharpe

As documented in paragraph 3.7, "From picocli 2.0, positional parameters can be specified anywhere on the command line, they no longer need to follow the options." Is it possible with PicoCLI 4.x to create the original behavior or something similar?

Want this to work "command -a X -version 1.2 -- --optA --optB=4".
Want this to fail "command -a X -version 1 2 -- --optA --optB=4". (user typo'd the decimal for option "version")

The parameters are declared like
@parameters
List extraParamaters;
but this prevents the parser from catching the typo. If I want all parameters to come after options or even after --, is it possible to configure the framework to do this? If so, I would expect the parser to catch that the "2" is a mismatched parameter, right?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions