15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/deploio/commands/orgs.rb', line 15
def list
setup_options
raw_orgs = @nctl.get_orgs
if options[:json]
puts JSON.pretty_generate(raw_orgs)
return
end
if raw_orgs.empty?
Output.warning("No organizations found") unless merged_options[:dry_run]
return
end
rows = raw_orgs.map do |org|
current_marker = org["current"] ? "*" : ""
[
current_marker,
presence(org["name"])
]
end
Output.table(rows, headers: ["", "ORGANIZATION"])
end
|