648件ヒット
[1-100件を表示]
(0.039秒)
種類
- インスタンスメソッド (576)
- 特異メソッド (72)
ライブラリ
- optparse (648)
キーワード
- accept (24)
-
default
_ argv (12) - environment (12)
- getopts (48)
- help (12)
- load (12)
- new (24)
- on (144)
-
on
_ head (12) -
on
_ tail (12) - order (48)
- order! (24)
- parse (24)
- parse! (12)
- permute (24)
- permute! (12)
-
program
_ name (12) - reject (24)
- release (12)
- separator (12)
- summarize (24)
-
summary
_ indent (12) -
summary
_ indent= (12) -
summary
_ width (12) -
summary
_ width= (12) -
to
_ a (12) -
to
_ s (12) - ver (12)
- version (12)
検索結果
先頭5件
- 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
# summary _ indent -> String - OptionParser
# summary _ width -> Integer - OptionParser
# on(long , *rest) {|v| . . . } -> self
-
OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) -> () (139.0) -
サマリを指定された to へと加えていきます。
...s = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summarize(["description\n"], 10, 8, " ")
# => ["description\n", " -i\n", " --in......it\n", " -u\n", " --update\n", " -h\n", " --help\n"]
//}... -
OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) {|line| . . . } -> () (139.0) -
サマリを指定された to へと加えていきます。
...s = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summarize(["description\n"], 10, 8, " ")
# => ["description\n", " -i\n", " --in......it\n", " -u\n", " --update\n", " -h\n", " --help\n"]
//}... -
OptionParser
# summary _ indent -> String (137.0) -
サマリを表示する時のインデントを文字列で返します。
...uby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summary_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summary_indent =......" "
opts.summary_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
//}... -
OptionParser
# summary _ width -> Integer (137.0) -
サマリを表示するときの幅を整数で返します。
...][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summary_width # => 32
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summary_width = 8
opts.......summary_width # =>8
opts.summarize
# => [" -i\n", " --init\n", " -u\n", " --update\n", " -h\n", " --help\n"]
//}... -
OptionParser
# on(long , *rest) {|v| . . . } -> self (128.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...ていれば呼ばれます。
コマンドに与えられた引数が配列やハッシュに含まれない場合、例外
OptionParser::InvalidArgument が OptionParser#parse 実行時
に発生します。
@param short ショートオプションを表す文字列を指定します。
@param......説明と見なします。
//emlist[][ruby]{
opts.on("--protocol VALUE", [:http, :ftp, :https]){|w|
p w
}
# ruby command --protocol=http #=> :http
opts.on("-c", "--charset VALUE", {"jis" => "iso-2022-jp", "sjis" => "shift_jis"}){|w|
p w
}
# ruby command --charset=jis #=> "iso-2022-jp"
//}... -
OptionParser
# on(short , *rest) {|v| . . . } -> self (128.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...ていれば呼ばれます。
コマンドに与えられた引数が配列やハッシュに含まれない場合、例外
OptionParser::InvalidArgument が OptionParser#parse 実行時
に発生します。
@param short ショートオプションを表す文字列を指定します。
@param......説明と見なします。
//emlist[][ruby]{
opts.on("--protocol VALUE", [:http, :ftp, :https]){|w|
p w
}
# ruby command --protocol=http #=> :http
opts.on("-c", "--charset VALUE", {"jis" => "iso-2022-jp", "sjis" => "shift_jis"}){|w|
p w
}
# ruby command --charset=jis #=> "iso-2022-jp"
//}... -
OptionParser
# on(short , long , *rest) {|v| . . . } -> self (128.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...ていれば呼ばれます。
コマンドに与えられた引数が配列やハッシュに含まれない場合、例外
OptionParser::InvalidArgument が OptionParser#parse 実行時
に発生します。
@param short ショートオプションを表す文字列を指定します。
@param......説明と見なします。
//emlist[][ruby]{
opts.on("--protocol VALUE", [:http, :ftp, :https]){|w|
p w
}
# ruby command --protocol=http #=> :http
opts.on("-c", "--charset VALUE", {"jis" => "iso-2022-jp", "sjis" => "shift_jis"}){|w|
p w
}
# ruby command --charset=jis #=> "iso-2022-jp"
//}... -
OptionParser
# release -> String (125.0) -
プログラムのリリースを文字列で返します。
...プログラムのリリースを文字列で返します。
//emlist[例][ruby]{
require "optparse"
OptionParser.new do |opts|
opts.release # => nil
opts.release = "2019-05-01"
opts.release # => "2019-05-01"
end
//}... -
OptionParser
# ver -> String (125.0) -
program_name、version と release から生成したバージョンを表す文字列を返します。
...ire "optparse"
OptionParser.new do |opts|
opts.banner = "Usage: example.rb [options]"
opts.program_name = "Optparse Example"
opts.version = [0, 1]
opts.release = "2019-05-01"
opts.on_tail("--version", "Show version") do
puts opts.ver # => "Optparse Example 0.1 (2019-05-01)"
exit...