Add default for grabbing an os

If a user does not specify a number of vms with the get command (i.e.
does not include an = sign after the os), the get command will assume
the user just wants 1 vm.
This commit is contained in:
Brian Cain 2015-10-16 15:48:16 -07:00
parent 4cf77bc4d4
commit 3a17b418cf

View file

@ -41,7 +41,12 @@ class Vmfloaty
os_types = {}
args.each do |arg|
os_arr = arg.split("=")
os_types[os_arr[0]] = os_arr[1].to_i
if os_arr.size == 1
# assume they didn't specify an = sign if split returns 1 size
os_types[os_arr[0]] = 1
else
os_types[os_arr[0]] = os_arr[1].to_i
end
end
no_token = options.notoken