Class: Gaptool::SvcAPIList

Inherits:
Clamp::Command
  • Object
show all
Defined in:
lib/gaptool-client.rb

Instance Method Summary collapse

Instance Method Details

#execute ⇒ Object



304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/gaptool-client.rb', line 304

def execute
  if service.nil?
    keyhash = $api.svcapi_showkeys(:all)
    keyhash.keys.each do |service|
      puts service.color(:green)
      keyhash[service].keys.each do |state|
        puts "  ┖  #{state}".color(:cyan)
        keyhash[service][state].each do |key|
          puts "    - #{key}"
        end
      end
    end
  else
    keyhash = $api.svcapi_showkeys(service)
    puts service.color(:green)
    keyhash.keys.each do |state|
      puts "  ┖  #{state}".color(:cyan)
      keyhash[state].each do |key|
        puts "    - #{key}"
      end
    end
  end
end