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

Don't prompt for password if it was passed as argument #195

Closed
bramp opened this issue Jun 19, 2014 · 6 comments
Closed

Don't prompt for password if it was passed as argument #195

bramp opened this issue Jun 19, 2014 · 6 comments

Comments

@bramp
Copy link

bramp commented Jun 19, 2014

This is a feature request. I would like to accept a password as a argument, or if it's missing prompt for it. This would work in a similar way to "mysql -p", for example:

$ mysql -p
Enter password: 
...

or

$ mysql -pSomething
...
@nikolavp
Copy link

Isn't this what you are looking for? Note that i recently did some "patching" work on the way the prompting works in a separate project.

Maybe this is not included in the documentation and is not clear enough?

@jeremysolarz
Copy link
Contributor

jeremysolarz commented Jan 15, 2017

@cbeust hm the request seems valid

A call like this

public class Password {
    public static class ArgsPassword {
        @Parameter(names = "-password", description = "Connection password", password = true)
        private String password;
    }

    public static void main(String[] args) {
        ArgsPassword arg = new ArgsPassword();
        JCommander jc = new JCommander(arg);
        jc.parse("-password", "test");
    }
}

still asks for the password.

@cbeust
Copy link
Owner

cbeust commented Jan 15, 2017

Agreed.

@triceo
Copy link
Contributor

triceo commented Mar 9, 2017

@jeremysolarz This issue is assigned to you - are you working on it? If not, I may take a stab at it.

@jeremysolarz jeremysolarz removed their assignment Mar 9, 2017
@jeremysolarz
Copy link
Contributor

Yes, please! 😄

@triceo
Copy link
Contributor

triceo commented Mar 9, 2017

@jeremysolarz PR submitted. Feel free to review or let me know if I should ask someone else.

@cbeust cbeust closed this as completed in 45aec91 Mar 9, 2017
cbeust added a commit that referenced this issue Mar 9, 2017
Never prompt for password if it was passed as an argument (fixes #195)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants