Method: WLIConfig#create_option_parser

Defined in:
lib/wliconfig.rb

#create_option_parser(container) ⇒ Object



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/wliconfig.rb', line 146

def create_option_parser(container)
  op = OptionParser.new


  op.banner = "wliconfig -- The 3rd party configuration cli for BUFFALO INC wireless lan adapters are called 'WLI' series.\n\nUsage: wliconfig [options...]"
  op.version = "1.0.0"

  op.on('-f FILE', 'Read options from specified YAML file.'){|v| container[:fname] = v}
  op.on('-a', '--addr ADDR', 'WLI product\'s ip address. (eg. 192.168.0.1)'){|v| container[:addr] = v}
  op.on('-u', '--user USERNAME', 'Basic auth username. (eg. admin)'){|v| container[:user] = v}
  op.on('-p', '--pass PASSWORD', 'Basic auth password. (eg. password)'){|v| container[:pass] = v}
  op.on('-s', '--wlan-ssid SSID', 'SSID that to connect wireless lan.'){|v| container[:wlan_ssid] = v}
  op.on('-m', '--wlan-mode MODE', 'Auth mode that to connect wireless lan. (none, wep_hex, wep_char, tkip, aes, wpa2_tkip or wpa2_aes is valid.)'){|v| container[:wlan_mode] = v}
  op.on('-k', '--wlan-key KEY', 'Key or pass phrase that to connect wireless lan.'){|v| container[:wlan_key] = v}
  op.on('--debug', 'For developers only. Enabled debug mode.'){|v| $debug = true}

  op
end