594件ヒット
[1-100件を表示]
(0.068秒)
種類
- インスタンスメソッド (528)
- 特異メソッド (66)
ライブラリ
- optparse (594)
キーワード
- accept (22)
-
default
_ argv (11) - environment (11)
- getopts (44)
- help (11)
- load (11)
- new (22)
- on (132)
-
on
_ head (11) -
on
_ tail (11) - order (44)
- order! (22)
- parse (22)
- parse! (11)
- permute (22)
- permute! (11)
-
program
_ name (11) - reject (22)
- release (11)
- separator (11)
- summarize (22)
-
summary
_ indent (11) -
summary
_ indent= (11) -
summary
_ width (11) -
summary
_ width= (11) -
to
_ a (11) -
to
_ s (11) - ver (11)
- version (11)
検索結果
先頭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... -
OptionParser
# on(long , pat = / . * / , desc = "") {|v| . . . } -> self (123.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...がパターンにマッチしない場合、
例外 OptionParser::InvalidArgument が parse 実行時に投げられます。
opts.on("--username VALUE", /[a-zA-Z0-9_]+/){|name| ...}
# ruby command --username=ruby_user
# ruby command --username=ruby.user #=> Error
@param short ショート...