176件ヒット
[1-100件を表示]
(0.048秒)
クラス
- OptionParser (176)
キーワード
-
default
_ argv (11) - environment (11)
- help (11)
- on (33)
- parse (22)
- parse! (11)
-
program
_ name (11) - release (11)
-
summary
_ indent (11) -
to
_ a (11) -
to
_ s (11) - ver (11)
検索結果
先頭5件
-
OptionParser
# summary _ indent -> String (263.0) -
サマリを表示する時のインデントを文字列で返します。
...e "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.su......mmary_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
//}... -
OptionParser
# ver -> String (251.0) -
program_name、version と release から生成したバージョンを表す文字列を返します。
...例][ruby]{
require "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-0......5-01)"
exit
end
opts.parse!(ARGV)
end
//}... -
OptionParser
# parse!(argv = self . default _ argv) -> [String] (245.0) -
与えられた argv をパースします。
...]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
ARGV # => ["-i", "-u", "-h", "test"]
opts.parse(ARGV) # => ["test"]
ARGV # => ["-i", "-u", "-h", "test"]
opts.parse!(ARGV... -
OptionParser
# parse!(argv = self . default _ argv , into: nil) -> [String] (245.0) -
与えられた argv をパースします。
...]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
ARGV # => ["-i", "-u", "-h", "test"]
opts.parse(ARGV) # => ["test"]
ARGV # => ["-i", "-u", "-h", "test"]
opts.parse!(ARGV... -
OptionParser
# parse(*args) -> [String] (240.0) -
与えられた argv をパースします。 argv からオプションを取り除いたものを返します。
...ラスになります。
//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
ARGV # => ["-i", "-u", "-h", "test"]
opts.parse(ARGV) # => ["test"]
//}... -
OptionParser
# parse(*args , into: nil) -> [String] (240.0) -
与えられた argv をパースします。 argv からオプションを取り除いたものを返します。
...ラスになります。
//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
ARGV # => ["-i", "-u", "-h", "test"]
opts.parse(ARGV) # => ["test"]
//}... -
OptionParser
# parse(argv) -> [String] (240.0) -
与えられた argv をパースします。 argv からオプションを取り除いたものを返します。
...ラスになります。
//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
ARGV # => ["-i", "-u", "-h", "test"]
opts.parse(ARGV) # => ["test"]
//}... -
OptionParser
# parse(argv , into: nil) -> [String] (240.0) -
与えられた argv をパースします。 argv からオプションを取り除いたものを返します。
...ラスになります。
//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
ARGV # => ["-i", "-u", "-h", "test"]
opts.parse(ARGV) # => ["test"]
//}... -
OptionParser
# to _ a -> [String] (239.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.to_a # => ["Usage: test [options]", " -i, --init\n", " -u, --update\n",... -
OptionParser
# help -> String (234.0) -
サマリの文字列を返します。
...します。
//emlist[例][ruby]{
require "optparse"
options = {}
opts = OptionParser.new do |opts|
opts.banner = "Usage: example.rb [options]"
opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
options[:verbose] = v
end
end
puts opts.help
# => Usage: example.rb [options]
# -v... -
OptionParser
# to _ s -> String (234.0) -
サマリの文字列を返します。
...します。
//emlist[例][ruby]{
require "optparse"
options = {}
opts = OptionParser.new do |opts|
opts.banner = "Usage: example.rb [options]"
opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
options[:verbose] = v
end
end
puts opts.help
# => Usage: example.rb [options]
# -v... -
OptionParser
# banner -> String (233.0) -
サマリの最初に表示される文字列を返します。
...返します。
//emlist[例][ruby]{
require "optparse"
options = {}
opts = OptionParser.new do |opts|
opts.banner = "Usage: example.rb [options]"
opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
options[:verbose] = v
end
end
p opts.banner # => "Usage: example.rb [options]"
//}... -
OptionParser
# on(long , klass = String , desc = "") {|v| . . . } -> self (229.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...インスタンス
に変換されてから、ブロックに渡されます。
opts.on("-w", "--width N", Integer){|w|
p w.class #=> Integer
}
# ruby command --width=32
opts.on("-o", "--overwrite VALUE", TrueClass){|boolean| ...}
# ruby command --overwrite yes
@param short ショ......場合に発生します。
=== デフォルトで利用可能な引数クラス
: Object
オプションの引数は変換されません。
: String
オプションの引数は変換されません。ただし、空文字列を指定すると
OptionParser::InvalidArgument が発生します......す。10進数のフォーマットを指定できます。
: TrueClass
true か false に変換されます。"yes" や "no"、"true" や "false"、"+"
や "-" を指定できます。オプションの引数を省略した場合は true になります。
また、"no-" をオプションの...