Method: Commander::UI.password
- Defined in:
- lib/commander/user_interaction.rb
.password(message = 'Password: ', mask = '*') ⇒ Object
Ask the user for a password. Specify a custom message other than ‘Password: ’ or override the default mask of ‘*’.
34 35 36 37 38 |
# File 'lib/commander/user_interaction.rb', line 34 def password = 'Password: ', mask = '*' pass = ask() { |q| q.echo = mask } pass = password , mask if pass.nil? || pass.empty? pass end |