Class: ICSP::Commands::Container::List

Inherits:
BaseCommand show all
Defined in:
lib/commands/container/list.rb

Instance Attribute Summary

Attributes inherited from BaseCommand

#arguments, #config, #options, #prompt

Instance Method Summary collapse

Methods inherited from BaseCommand

#initialize

Constructor Details

This class inherits a constructor from ICSP::Commands::BaseCommand

Instance Method Details

#csptestObject



7
8
9
# File 'lib/commands/container/list.rb', line 7

def csptest
  @csptest ||= @config.csptest
end

#executeObject



11
12
13
14
15
16
# File 'lib/commands/container/list.rb', line 11

def execute
  result = ::ICSP::Shell.new("#{csptest} -keyset -enum_containers -verifycontext -fqcn").execute
  exit(result.exit_code) unless result.ok

  result.output_lines.filter { |l| l.start_with?('\\') }
end


18
19
20
# File 'lib/commands/container/list.rb', line 18

def print
  puts execute
end

#selectObject



22
23
24
# File 'lib/commands/container/list.rb', line 22

def select
  @prompt.select('Choose container:', execute)
end