vmc-ng/lib/vmc/cli/app.rb in vmc-0.4.0.beta.59 vs vmc-ng/lib/vmc/cli/app.rb in vmc-0.4.0.beta.60
- old
+ new
@@ -13,12 +13,12 @@
}
input :name, :desc => "Filter by name regexp"
input :runtime, :desc => "Filter by runtime regexp"
input :framework, :desc => "Filter by framework regexp"
input :url, :desc => "Filter by url regexp"
- input :one_line, :alias => "-l", :type => :boolean, :default => false,
- :desc => "Single-line tabular format"
+ input :full, :type => :boolean, :default => false,
+ :desc => "Verbose output format"
def apps
msg =
if space = input[:space]
"Getting applications in #{c(space.name, :name)}"
else
@@ -42,12 +42,15 @@
!app_matches(a, input)
end
apps = apps.sort_by(&:name)
- if input[:one_line]
-
+ if input[:full]
+ spaced(apps) do |a|
+ display_app(a)
+ end
+ else
table(
["name", "status", "usage", v2? && "plan", "runtime", "url"],
apps.collect { |a|
[ c(a.name, :name),
app_status(a),
@@ -61,14 +64,10 @@
else
"#{a.url}, ..."
end
]
})
- else
- spaced(apps) do |a|
- display_app(a)
- end
end
end
desc "Show app information"
@@ -786,21 +785,25 @@
app.total_instances = instances
end
end
if input.given?(:framework)
- framework = input[:framework, client.frameworks]
+ all_frameworks = client.frameworks
+ framework = input[:framework, all_frameworks, all_frameworks]
+
if framework != app.framework
diff[:framework] = [app.framework.name, framework.name]
app.framework = framework
end
end
if input.given?(:runtime)
- runtime = input[:runtime, client.runtimes]
+ all_runtimes = client.runtimes
+ runtime = input[:runtime, all_runtimes, all_runtimes]
+
if runtime != app.runtime
diff[:runtime] = [app.runtime.name, runtime.name]
app.runtime = runtime
end
end
@@ -861,25 +864,25 @@
[detected_framework],
detected_framework,
:other
]
else
- framework = input[:framework, all_frameworks]
+ framework = input[:framework, all_frameworks, all_frameworks]
end
if framework.name == "standalone"
detected_runtimes = detector.detect_runtimes
else
- detected_runtimes = detector.runtimes(framework)
+ detected_runtimes = detector.runtimes(framework) || []
end
if detected_runtimes.size == 1
default_runtime = detected_runtimes.first
end
if detected_runtimes.empty?
- runtime = input[:runtime, all_runtimes]
+ runtime = input[:runtime, all_runtimes, all_runtimes]
else
runtime = input[
:runtime,
all_runtimes,
detected_runtimes,