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

Support populating custom field types (not just arrays and Collections) from multiple options/parameters #107

Closed
remkop opened this issue Apr 20, 2017 · 2 comments

Comments

@remkop
Copy link
Owner

remkop commented Apr 20, 2017

e.g. <command> -x 123 "name" HOURS

@Option(names = "-x", type = {Integer.class, String.class, TimeUnit.class}, arity = "3")
MyBean mybean;   // TBD arity must match the number of classes in the type attribute?

where

class MyBean { // all that is required is a public constructor matching the specified types
    public MyBean(int number, String string, TimeUnit timeUnit) {
        this.number = number;
        this.string= string;
        this.timeUnit= timeUnit;
    }
    ....

Of course, -x 123,name,HOURS could also be converted by a custom ITypeConverter

@remkop remkop added this to the 1.0.0 advanced option parsing milestone Apr 20, 2017
@remkop remkop changed the title Support initializing a field from multiple options/parameters Support initializing custom field types (not just arrays and Collections) from multiple options/parameters Apr 20, 2017
@remkop remkop changed the title Support initializing custom field types (not just arrays and Collections) from multiple options/parameters Support populating custom field types (not just arrays and Collections) from multiple options/parameters Apr 25, 2017
@remkop remkop modified the milestones: backlog, 3.1 Mar 9, 2018
@remkop
Copy link
Owner Author

remkop commented Apr 22, 2018

Somewhat related to #358.

@remkop remkop modified the milestones: 3.1, 3.x Apr 22, 2018
@remkop remkop modified the milestones: 3.4, 3.5 Jul 23, 2018
@remkop remkop modified the milestones: 3.5, 3.6 Aug 3, 2018
@remkop remkop modified the milestones: 3.6, 3.7 Sep 12, 2018
@remkop remkop modified the milestones: 3.7, 3.8 Oct 19, 2018
@remkop remkop modified the milestones: 4.1, 4.0 Feb 20, 2019
@remkop remkop modified the milestones: 4.0, 4.0-alpha-1 Mar 30, 2019
@remkop
Copy link
Owner Author

remkop commented Mar 30, 2019

Picocli 4.0.0-alpha-1 has been released which includes support for repeating composite groups,. This should address this use case.
See https://picocli.info/#_argument_groups for details.

@remkop remkop closed this as completed Mar 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant