From 3a17b418cf86f37c9f6dcc1c5b9648a31e8a0ae7 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Fri, 16 Oct 2015 15:48:16 -0700 Subject: [PATCH] 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. --- lib/vmfloaty.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/vmfloaty.rb b/lib/vmfloaty.rb index 34d7586..2965b83 100644 --- a/lib/vmfloaty.rb +++ b/lib/vmfloaty.rb @@ -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