service: service add <service-id> [token=provider [...]]
parent
59b78e3af5
commit
c6dd306361
|
@ -49,24 +49,25 @@ begin
|
|||
if args[0] == "help"
|
||||
puts parser
|
||||
elsif args[0] == "add"
|
||||
environment : String? = nil
|
||||
providers = Hash(String, String).new
|
||||
|
||||
environment, service = Service.parse_id args[1]
|
||||
|
||||
args.shift
|
||||
args.each_with_index do |arg, i|
|
||||
next if i == 0
|
||||
|
||||
match = arg.match /(.*)=(.*)/
|
||||
|
||||
if match.nil?
|
||||
# FIXME: Check environment is not defined already.
|
||||
environment = arg
|
||||
raise ::Service::Exception.new "usage: service add <service> <token=provider>"
|
||||
next
|
||||
end
|
||||
|
||||
providers[match[1]] = match[2]
|
||||
end
|
||||
|
||||
Service.new(args[1], environment).tap do |service|
|
||||
Service.new(service, environment).tap do |service|
|
||||
service.consumes.each do |token|
|
||||
provider = providers[token.token]?
|
||||
|
||||
|
|
Loading…
Reference in New Issue