be more strict on password arg, check if password was set

pull/1498/head
Cory LaNou 2015-02-03 15:19:52 -07:00
parent 7b5af491d7
commit bc264fc430
1 changed files with 1 additions and 2 deletions

View File

@ -52,9 +52,8 @@ func main() {
var promptForPassword bool
// determine if they set the password flag but provided no value
for _, v := range os.Args {
v = strings.Replace(v, "-", "", -1)
v = strings.ToLower(v)
if strings.HasPrefix(v, "password") {
if (strings.HasPrefix(v, "-password") || strings.HasPrefix(v, "--password")) && c.Password == "" {
promptForPassword = true
break
}