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

Treat char[] as single-value types (Potentially breaking change) #1846

Closed
remkop opened this issue Oct 16, 2022 · 0 comments
Closed

Treat char[] as single-value types (Potentially breaking change) #1846

remkop opened this issue Oct 16, 2022 · 0 comments
Labels
theme: parser An issue or change related to the parser type: enhancement ✨
Milestone

Comments

@remkop
Copy link
Owner

remkop commented Oct 16, 2022

(Related to #648, #1834 and #1838):

Currently, the picocli parser treats options and positional parameters with type char[] as array (multi-value) options.
There is some special logic for interactive char[] options, but this is fragile, as pointed out in #1834.

A better solution is to treat all char[] options as single-value options, similar to String options.

For end users, this means that existing applications that use non-interactive char[] options will no longer allow multiple characters to be specified separately on the command line. That is, input like -c A -c B -c C will be rejected and the user needs to specify -c ABC instead.

Applications that want to preserve the previous behaviour will need to change their code to use java.lang.Character[] instead of char[].

@remkop remkop added type: enhancement ✨ theme: parser An issue or change related to the parser labels Oct 16, 2022
@remkop remkop added this to the 4.7 milestone Oct 16, 2022
remkop added a commit that referenced this issue Oct 16, 2022
remkop added a commit that referenced this issue Oct 30, 2022
@remkop remkop closed this as completed Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: parser An issue or change related to the parser type: enhancement ✨
Projects
None yet
Development

No branches or pull requests

1 participant