Method: Example::Arguments#initialize

Defined in:
examples/example.rb

#initialize(argv) ⇒ Arguments

Returns a new instance of Arguments.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'examples/example.rb', line 31

def initialize(argv)
  @interface = '127.0.0.1'
  @tls = :explicit
  @port = 0
  @auth_level = 'password'
  # When running on travisci, the LOGNAME environment variable is
  # not set, but we require it to be set.
  @user = ENV['LOGNAME'] || "test"
  @password = ''
  @account = ''
  @session_timeout = default_session_timeout
  @log = nil
  @nat_ip = nil
  @passive_ports = nil
  op = option_parser
  op.parse!(argv)
rescue OptionParser::ParseError => e
  $stderr.puts e
  exit(1)
end