るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.026秒)
トップページ > バージョン:2.3.0[x] > クエリ:new[x] > クエリ:data[x] > ライブラリ:optparse[x]

別のキーワード

  1. openssl new
  2. _builtin new
  3. rexml/document new
  4. resolv new
  5. socket new

クラス

検索結果

OptionParser#environment(env) -> [String] (61.0)

環境変数 env に対して Shellwords.#shellwords を呼 んで配列にしてから parse を行ないます。

...実際は OptionParser::ParseError のサブク
ラスになります。

//emlist[例][ruby]{
require "optparse"

config = {}
opts = OptionParser.new
opts.on("-r", "--require LIBRARY"){|lib| config[:lib] = lib }

# HOGE_OPT は hoge というプログラム...