lib/cli/commands/admin.rb in vmc-0.3.13.beta.2 vs lib/cli/commands/admin.rb in vmc-0.3.13.beta.3

- old
+ new

@@ -20,16 +20,16 @@ end alias :users :list_users def add_user(email=nil) - email = @options[:email] unless email + email ||= @options[:email] + email ||= ask("Email") unless no_prompt password = @options[:password] - email = ask("Email: ") unless no_prompt || email unless no_prompt || password - password = ask("Password: ") {|q| q.echo = '*'} - password2 = ask("Verify Password: ") {|q| q.echo = '*'} + password = ask("Password", :echo => "*") + password2 = ask("Verify Password", :echo => "*") err "Passwords did not match, try again" if password != password2 end err "Need a valid email" unless email err "Need a password" unless password display 'Creating New User: ', false @@ -51,11 +51,14 @@ @options[:proxy] = user_email apps = client.apps if (apps && !apps.empty?) unless no_prompt - proceed = ask("\nDeployed applications and associated services will be DELETED, continue? [yN]: ") - err "Aborted" if proceed.upcase != 'Y' + proceed = ask( + "\nDeployed applications and associated services will be DELETED, continue?", + :default => false + ) + err "Aborted" unless proceed end cmd = Apps.new(@options) apps.each { |app| cmd.delete_app(app[:name], true) } end