5件ヒット
[1-5件を表示]
(0.124秒)
検索結果
先頭5件
- OptionParser
# on _ head(*arg , &block) -> self - OptionParser
# on _ tail(*arg , &block) -> self - OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) -> () - OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) {|line| . . . } -> () - OptionParser
# parse!(argv = self . default _ argv) -> [String]
-
OptionParser
# on _ head(*arg , &block) -> self (54628.0) -
オプションを取り扱うためのブロックを自身の持つリストの最初に登録します。
...ックを自身の持つリストの最初に登録します。
@param arg OptionParser#on と同様です。
@param block OptionParser#on と同様です。
//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opt......s.on_tail("-h", "--help")
end
puts opts.help
# => Usage: test [options]
# -i, --init
# -u, --update
# -h, --help
//}
@see OptionParser#on, OptionParser#on_tail... -
OptionParser
# on _ tail(*arg , &block) -> self (18343.0) -
オプションを取り扱うためのブロックを自身の持つリストの最後に登録します。
...明をサマリの最後に表示したい時に便利です。
@param arg OptionParser#on と同様です。
@param block OptionParser#on と同様です。
//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opt......, --help
//}
//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new
opts.on_tail("-h", "--help", "Show this message") do
puts opts
exit
end
opts.on_tail("--version", "Show version") do
puts OptionParser::Version.join('.')
exit
end
//}
@see OptionParser#on, OptionParser#on_head... -
OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) -> () (625.0) -
サマリを指定された to へと加えていきます。
...指定します。
@param indent サマリのインデントを文字列で指定します。
//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summarize
# => [" -i, --in... -
OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) {|line| . . . } -> () (625.0) -
サマリを指定された to へと加えていきます。
...指定します。
@param indent サマリのインデントを文字列で指定します。
//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summarize
# => [" -i, --in... -
OptionParser
# parse!(argv = self . default _ argv) -> [String] (325.0) -
与えられた argv をパースします。
...
OptionParser#permute! と同様に argv を破壊的にパースします。
環境変数に POSIXLY_CORRECT が設定されている場合は、
OptionParser#order! と同様に振舞います。
@param argv パースしたい引数を文字列の配列で指定します。
@raise OptionParser......た場合、発生します。
実際は OptionParser::ParseError のサブク
ラスになります。
//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update...