Skip to content

Commit

Permalink
Added documentation for new parser configuration option
Browse files Browse the repository at this point in the history
  • Loading branch information
ddsharpe committed Jan 3, 2024
1 parent 97dd03b commit eca3fc4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,9 @@ assert(mixed.positional == Arrays.asList("param0", "param1", "param2", "param3")
assert(mixed.options == Arrays.asList("AAA", "BBB"))
----

Note that the mixing of positional parameters and options is configurable, see <<End of Options Behaviour>>.


=== Double dash (`--`)
When one of the command line arguments is just two dashes without any characters attached (`--`),
picocli interprets all following arguments as positional parameters, even arguments that match an option name.
Expand Down Expand Up @@ -5261,6 +5264,12 @@ java App -x -y -y=123
----


=== End of Options Behaviour
Since picocli 2.0, positional parameters can be specified anywhere on the command line and no longer need to follow the options.
Starting with v4.8.0, `CommandLine::setParameterAllowedBeforeEndOfOptions` can be set to false in order to restrict
the mixing of options and positional parameters. This option forces positional parameters to follow the <<Double dash (`--`),End of Options delimiter>>.


=== Toggle Boolean Flags
When a flag option is specified on the command line picocli will set its value to the opposite of its _default_ value.

Expand Down

0 comments on commit eca3fc4

Please sign in to comment.