Method: Pantry::CLI#perform

Defined in:
lib/pantry/cli.rb

#perform(options, arguments) ⇒ Object

Given the parsed options and the arguments left over, figure out what Command was requested, build up the appropriate structures and start the communication process.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/pantry/cli.rb', line 65

def perform(options, arguments)
  command_info, command_options = @command_line.triggered_command

  if command_info
    client_filter = Pantry::Communication::ClientFilter.new(
      application: options['application'],
      environment: options['environment'],
      roles:       options['roles']
    )

    command = command_info[:class].new(*arguments)
    command_options = command_options.merge(options)

    request(client_filter, command, command_options)
  else
    $stderr.puts "I don't know the #{arguments.first} command"
  end
end