2019-10-25 13:10:20 +02:00
|
|
|
|
2019-10-20 18:05:31 +02:00
|
|
|
require "./config.cr"
|
2019-10-29 12:32:49 +01:00
|
|
|
require "./service/environment.cr"
|
|
|
|
require "./service/service_definition.cr"
|
|
|
|
require "./service/service.cr"
|
2019-10-20 18:05:31 +02:00
|
|
|
|
2019-11-09 21:52:43 +01:00
|
|
|
context = Service::Context.new
|
|
|
|
context.load
|
2019-10-20 18:05:31 +02:00
|
|
|
|
2019-10-29 12:32:49 +01:00
|
|
|
if ARGV.size != 2
|
|
|
|
STDERR.puts "usage: get-port <service-id> <port-id>"
|
|
|
|
exit 1
|
2019-10-25 13:10:20 +02:00
|
|
|
end
|
2019-10-20 18:05:31 +02:00
|
|
|
|
2019-10-29 12:32:49 +01:00
|
|
|
service_id, port_id = ARGV
|
2019-10-20 18:05:31 +02:00
|
|
|
|
2019-11-09 21:52:43 +01:00
|
|
|
puts context.get_service_by_id(service_id).not_nil!.ports[port_id]
|
2019-10-20 18:05:31 +02:00
|
|
|
|