vmc-ng/lib/vmc/cli/service.rb in vmc-0.4.0.beta.63 vs vmc-ng/lib/vmc/cli/service.rb in vmc-0.4.0.beta.64
- old
+ new
@@ -83,17 +83,17 @@
:desc => "Name for your instance") { |service|
random = sprintf("%x", rand(1000000))
ask "Name?", :default => "#{service.label}-#{random}"
}
input(:plan, :desc => "Service plan",
+ :default => proc { |plans|
+ plans.find { |p| p.name == "D100" } ||
+ interact
+ },
:from_given => find_by_name_insensitive("plan")) { |plans|
- if d100 = plans.find { |p| p.name == "D100" }
- d100
- else
- ask "Which plan?", :choices => plans.sort_by(&:name),
- :display => proc { |p| "#{p.name}: #{p.description}" },
- :complete => proc(&:name)
- end
+ ask "Which plan?", :choices => plans.sort_by(&:name),
+ :display => proc { |p| "#{p.name}: #{p.description}" },
+ :complete => proc(&:name)
}
input :provider, :desc => "Service provider"
input :version, :desc => "Service version"
input :app, :alias => "--bind", :from_given => by_name("app"),
:desc => "Application to immediately bind to"