lib/vmc/cli/service/create.rb in vmc-0.5.0.beta.7 vs lib/vmc/cli/service/create.rb in vmc-0.5.0.beta.10

- old
+ new

@@ -32,10 +32,13 @@ offerings.reject! { |s| s.version != input[:version] } elsif !v2? offerings.reject!(&:deprecated?) end - if v2? && plan = input.given(:plan) + # filter the offerings based on a given plan value, which will be a + # string if the user provided it with a flag, or a ServicePlan if + # something invoked this command with a particular plan + if v2? && plan = input.direct(:plan) offerings.reject! do |s| if plan.is_a?(String) s.service_plans.none? { |p| p.name == plan.upcase } else s.service_plans.include? plan