service/src/get-port.cr

19 lines
358 B
Crystal
Raw Permalink Normal View History

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
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
puts context.get_service_by_id(service_id).not_nil!.ports[port_id]
2019-10-20 18:05:31 +02:00