Sha256: 356472d00fa8bb29b3d0792ee2945c9746468c906f220ecf06bb15e1f0214b0c
Contents?: true
Size: 980 Bytes
Versions: 2
Compression:
Stored size: 980 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 runner = Runner.new(options.host, options.port, client, options.reservation) runner.start()
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
software_challenge_client-0.1.5 | example/main.rb |
software_challenge_client-0.1.4 | example/main.rb |