-
Notifications
You must be signed in to change notification settings - Fork 12
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
How to customized PropertySource on some subcommand #20
Comments
@tchiotludo I'm not 100% sure I get what you're trying to achieve 🤔 You want to define a config property |
In my special case, I need to inject custom You could find an implementation here :
|
If remkop/picocli#2079 got implemented, I think we could do something to simplify it. |
@tchiotludo is this solution feasible for you? |
I've an application with subcommands like that :
I want to be able to add some PropertySource (custom configuration) for only 1 subcommands (for example
SubCmd2.class
will add a configuration"myapp.myconfig": "foo"
only when running te command from SubCmd2).I don't think it's possible for now ?
The only solution I see is to used this signature when init Picocli :
instead of simple on
PicocliRunner.call(App.class, args);
in order to provide some configuration directly inApplicationContext
but this will need to parse theString[] args
to determine the current command, that is not really easy and can be buggy since it's not parse by picocli.The text was updated successfully, but these errors were encountered: