-
Notifications
You must be signed in to change notification settings - Fork 422
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
Optional interactive #536
Comments
@Zethson At the moment picocli does not support this. There is a section in the manual about combining interactive use with non-interactive use. Basically, if you need this, one idea is to have separate options, like |
I see, thanks! It's more or less the only thing that I miss from Click . |
Understood. Not sure when I'll get to it. class App {
@Option(names = "--password", interactive = true)
String password;
@Parameters
String[] otherParams;
} Now, if the end user specifies some input:
Currently picocli will interactively ask for a password and put This will change after this feature request is implemented: for the same input, the |
What Click does is that every parameter that was not passed and labeled as interactive is prompted. Everything that was passed is not going to be prompted.
|
I guess I will either have to live with potentially breaking existing applications, or introduce some extra flag that needs to be set for picocli to accept values following |
I'm afraid yes. I prefer the potentially breaking change, but this is of course up to you. Thanks! |
JCommander actually implemented this feature request:
But that caused an issue in certain use cases (application did not want to allow users to specify the password in plain text as an option parameter): One possible solution for this last use case is to use If the application author defines the option with |
@Zethson, it took a while, but this has finally been implemented. By default, interactive options now have I’ll release 3.9.6 with this change soon. |
Amazing. Thank you for your hard work. |
Hi,
I'm having the following issue:
I have a password CommandLine.Option, which is currently interactive -> thus it asks the user for his password.
However, I would like to skip the interactive question, if a password was already provided.
Is it possible to consume the interactive request?
The text was updated successfully, but these errors were encountered: