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 message = 'Password: ', mask = '*'
  pass = ask(message) { |q| q.echo = mask }
  pass = password message, mask if pass.nil? || pass.empty?
  pass
end