Revision dc0c5923
Added by Brian Gupta about 12 years ago
- ID dc0c59235e84e9262b5b5a75da7a3bfe69041598
extras/cli/foremancli | ||
---|---|---|
when "yaml"
|
||
YAML.dump(response)
|
||
else
|
||
(response.first.is_a?(Hash) ? response.map{|o| o.inspect} : response).join("\n")
|
||
r = response.first
|
||
if r.is_a?(Hash)
|
||
# we simply return host list
|
||
if r.first[0] == "host"
|
||
response.map{|h| h["host"]["name"]}
|
||
else
|
||
response.map{|o| o.inspect}
|
||
end
|
||
else
|
||
response.join("\n")
|
||
end
|
||
end)
|
||
end
|
||
|
Also available in: Unified diff
foremancli changes to support change in default host list API behavior.