852件ヒット
[1-100件を表示]
(0.022秒)
種類
- インスタンスメソッド (756)
- 特異メソッド (84)
- クラス (12)
クラス
- OptionParser (648)
-
OptionParser
:: ParseError (108)
モジュール
キーワード
- OptionParser (12)
- accept (24)
- args (12)
-
default
_ argv (12) - environment (12)
-
filter
_ backtrace (12) - getopts (60)
- help (12)
- inspect (12)
- load (12)
- new (24)
- on (144)
-
on
_ head (12) -
on
_ tail (12) - order (48)
- order! (48)
- parse (24)
- parse! (24)
- permute (24)
- permute! (24)
-
program
_ name (12) - reason (12)
- recover (12)
- reject (24)
- release (12)
- separator (12)
-
set
_ backtrace (12) -
set
_ option (12) - summarize (24)
-
summary
_ indent (12) -
summary
_ indent= (12) -
summary
_ width (12) -
summary
_ width= (12) -
to
_ a (12) -
to
_ s (24) - 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
:: Arguable # getopts(short _ opt , *long _ opt) -> Hash
-
OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) -> () (140.0) -
サマリを指定された to へと加えていきます。
..."optparse"
opts = 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", " --init\n", " -u\n", " --update\n", " -h\n", " --help\n"]
//}... -
OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) {|line| . . . } -> () (140.0) -
サマリを指定された to へと加えていきます。
..."optparse"
opts = 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", " --init\n", " -u\n", " --update\n", " -h\n", " --help\n"]
//}... -
OptionParser
# summary _ indent -> String (138.0) -
サマリを表示する時のインデントを文字列で返します。
...t[例][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_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summary_i......ndent = " "
opts.summary_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
//}... -
OptionParser
# summary _ width -> Integer (138.0) -
サマリを表示するときの幅を整数で返します。
...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.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
:: Arguable # getopts(short _ opt , *long _ opt) -> Hash (138.0) -
指定された short_opt や long_opt に応じて自身をパースし、結果を Hash として返します。
...返します。
コマンドラインに - もしくは -- を指定した場合、それ以降の解析を行ないません。
@param short_opt ショートネームのオプション(-f や -fx)を文字列で指定します。オプションが -f と -x の
2つの場合は "......ラスの例外になります。
//emlist[t.rb][ruby]{
require 'optparse'
params = ARGV.getopts("ab:", "foo", "bar:", "bufsize:1024")
p params
//}
# 実行結果
$ ruby t.rb -b 1 --foo --bar xxx -- -a
{"bufsize"=>"1024", "a"=>false, "b"=>"1", "foo"=>true, "bar"=>"xxx"} # "a"=>... -
OptionParser
# on(long , *rest) {|v| . . . } -> self (129.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...説明と見なします。
//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 (129.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...説明と見なします。
//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 (129.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...説明と見なします。
//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 (126.0) -
プログラムのリリースを文字列で返します。
...プログラムのリリースを文字列で返します。
//emlist[例][ruby]{
require "optparse"
OptionParser.new do |opts|
opts.release # => nil
opts.release = "2019-05-01"
opts.release # => "2019-05-01"
end
//}...