Sha256: 21c9c1a05b896ed3f615c2d195f0d5822961695c0a6979d1fce41014365a7126
Contents?: true
Size: 993 Bytes
Versions: 11
Compression:
Stored size: 993 Bytes
Contents
#!/usr/bin/env ruby # encoding: UTF-8 require 'software_challenge_client' require 'optparse' require 'ostruct' require_relative 'client' options = OpenStruct.new options.host = '127.0.0.1' options.port = 13050 options.reservation = '' opt_parser = OptionParser.new do |opt| opt.banner = "Usage: main.rb [OPTIONS]" opt.separator "" opt.separator "Options" opt.on("-p","--port PORT", Integer,"connect to the server at PORT (default #{options.port})") do |p| options.port = p end opt.on("-h","--host HOST","the host's IP address (default #{options.host})") do |h| options.host = h end opt.on("-r","--reservation RESERVATION","the host's RESERVATION (default #{options.reservation})") do |r| options.reservation = r end opt.on_tail("-?", "--help", "Show this message") do puts opt exit end end opt_parser.parse!(ARGV) client = Client.new(Logger::DEBUG) runner = Runner.new(options.host, options.port, client, options.reservation) runner.start
Version data entries
11 entries across 11 versions & 1 rubygems