remkop / picocli

Picocli is a modern framework for building powerful, user-friendly, GraalVM-enabled command line apps with ease. It supports colors, autocompletion, subcommands, and more. In 1 source file so apps can include as source & avoid adding a dependency. Written in Java, usable from Groovy, Kotlin, Scala, etc.

Home Page:https://picocli.info

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Configuring end-of-options position after parameter

sdaschner opened this issue · comments

Is it possible to configure the end-of-options flag to be after a certain required parameter?

I.e. basically to enable this: kubectl exec [options] <name> [--] <command> [args...]

Technically it works if I set showEndOfOptionsDelimiterInUsageHelp to true so that the delimiter is shown in the help, but it would be nice to change the position.

Right now, it would show up as: kubectl exec [options] [--] <name> <command>... (which works technically, but the first version would be clearer to the user).

Sorry, this is currently not possible.
The thinking was to display the -- end of options delimiter between the options and the positional parameters, to clarify that everything that follows is not an option, but a positional parameter.

Actually, there is a way to do what you have in mind, which is to take complete control of the synopsis in the application:
see https://picocli.info//#_custom_synopsis

Hope this helps.

Oh ok, yes it does help. The parser works with both positions of the --, so that's fine for me. Even better if I can change the usage help. Thanks, closing