Do not ask for password if token is provided

This commit is contained in:
Brian Cain 2015-09-15 10:44:51 -07:00
parent 562b811867
commit 9e4e7b3dab

View file

@ -27,13 +27,13 @@ class Vmfloaty
c.option '--os STRING', String, 'Operating systems to retrieve'
c.action do |args, options|
verbose = options.verbose || config['verbose']
token = options.token
token = options.token || config['token']
user = options.user ||= config['user']
url = options.url ||= config['url']
os_types = options.os
pass = password "Enter your password please:", '*'
unless options.token
pass = password "Enter your password please:", '*'
token = Auth.get_token(verbose, url, user, pass)
end