You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
358 B

require "./config.cr"
require "./service/environment.cr"
require "./service/service_definition.cr"
require "./service/service.cr"
context = Service::Context.new
context.load
if ARGV.size != 2
STDERR.puts "usage: get-port <service-id> <port-id>"
exit 1
end
service_id, port_id = ARGV
puts context.get_service_by_id(service_id).not_nil!.ports[port_id]