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

Custom factory not used when creating CommandSpec #1779

Closed
charphi opened this issue Aug 19, 2022 · 3 comments
Closed

Custom factory not used when creating CommandSpec #1779

charphi opened this issue Aug 19, 2022 · 3 comments
Milestone

Comments

@charphi
Copy link
Contributor

charphi commented Aug 19, 2022

Custom factory as described here is not used when creating a CommandSpec. The default one is always used instead.

See picocli.CommandLine.Model.CommandReflection#extractCommandSpec.

The faulty line is

CommandSpec result = CommandSpec.wrapWithoutInspection(userObject);

and should be replaced by

CommandSpec result = CommandSpec.wrapWithoutInspection(userObject, factory);
@remkop
Copy link
Owner

remkop commented Aug 23, 2022

Thank you for raising this.

Will you be able to provide a pull request for this?

@charphi
Copy link
Contributor Author

charphi commented Aug 23, 2022

Unfortunately not. I'm currently experiencing some issues with my corporate firewall that prevent me from downloading the required resources. 😞

@remkop remkop closed this as completed in cf0a049 Aug 23, 2022
@remkop
Copy link
Owner

remkop commented Aug 23, 2022

Fixed in main.
Thanks for raising this!

If you could provide a test to verify this, that would be super helpful. 🙏
Thank you again!

@remkop remkop added this to the 4.7 milestone Aug 23, 2022
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

2 participants