Class: Nutella::Broker

Inherits:
Command show all
Defined in:
lib/commands/broker.rb

Instance Method Summary collapse

Instance Method Details

#run(args = nil) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/commands/broker.rb', line 8

def run(args=nil)

  # If no argument then we just display info about the broker
  if args==nil || args.empty?
    print_broker_info
    return
  end
  # If there are arguments we are doing manipulations
  sub_command = args[0]
  sum_command_param = args[1]
  if sub_command=='set'
    change_broker sum_command_param
  else
    console.warn "Unknown 'nutella broker' option #{sub_command}. Try 'nutella broker' or 'nutella broker set <new_broker>' instead"
  end
end