From 9e4e7b3dabbdb17b3f4b153297f3b727f3f59dcc Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Tue, 15 Sep 2015 10:44:51 -0700 Subject: [PATCH] Do not ask for password if token is provided --- lib/vmfloaty.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vmfloaty.rb b/lib/vmfloaty.rb index bd94992..a8fc29f 100644 --- a/lib/vmfloaty.rb +++ b/lib/vmfloaty.rb @@ -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