-
Notifications
You must be signed in to change notification settings - Fork 429
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
Add an option to intercept executed Commands #2363
Comments
Two ideas come to mind:
Thoughts? |
Hi @remkop, thank you for your feedback.
I raised a separate pr (camel#16907) to customize parameters with Java System Properties using the
Unfortunately, that would be cumbersome to maintain because Camel JBang provides tens of different commands and we would need to keep it in sync. Also, we use JBang with other 3rd-party scripts. In my opinion, a more general approach within Picocli would be advantageous, offering greater flexibility and more options for customization. PFA a pr (#2364) with the proposed solution |
@remkop when is the next Picocli release planned? |
Currently, it is not possible to override default option/parameter values transparently for a user.
We use jBang and Camel jBang to run Camel routes. Internally, both these tools use Picocli to provide CLI experience.
It would be very useful to be able to intercept the executed command and override the default values if not explicitly provided as command line arguments. I could use
picocli.CommandLine.IDefaultValueProvider
but the problem is that I don't have control over 3rd projects which use Picocli, hence I can't customize thepicocli.CommandLine
instance. The proposed solution is to use Java System Property or Java SPI (java.util.ServiceLoader
) to set a listener class.The text was updated successfully, but these errors were encountered: