84件ヒット
[1-84件を表示]
(0.013秒)
別のキーワード
クラス
- OptionParser (84)
検索結果
先頭5件
-
OptionParser
# parse!(argv = self . default _ argv) -> [String] (32.0) -
与えられた argv をパースします。
...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"]
ARGV # => ["-i", "-u", "-h", "test"]
opts.parse!(......ARGV) # => ["test"]
ARGV # => ["test"]
//}... -
OptionParser
# parse!(argv = self . default _ argv , into: nil) -> [String] (32.0) -
与えられた argv をパースします。
...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"]
ARGV # => ["-i", "-u", "-h", "test"]
opts.parse!(......ARGV) # => ["test"]
ARGV # => ["test"]
//}... -
OptionParser
# program _ name=(name) (20.0) -
プログラムの名前を文字列で指定します。
...名前を文字列で指定します。
//emlist[例][ruby]{
require "optparse"
OptionParser.new do |opts|
$0 # => /path/to/filename.rb
opts.program_name # => filename
opts.program_name = 'test' # => "test"
opts.program_name # => "test"
end
//}... -
OptionParser
# parse(*args) -> [String] (14.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] (14.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] (14.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] (14.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
# on _ head(*arg , &block) -> self (8.0) -
オプションを取り扱うためのブロックを自身の持つリストの最初に登録します。
...tionParser#on と同様です。
//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
puts opts.help
# => Usage: test [options]
# -i, --init
# -u, --update
# -h, --help
//}... -
OptionParser
# on _ tail(*arg , &block) -> self (8.0) -
オプションを取り扱うためのブロックを自身の持つリストの最後に登録します。
...]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
puts opts.help
# => Usage: test [options]
# -i, --init
# -u, --update
# -h, --help
//}
//emlist[例][ruby]{
require "optparse"
opts = Op... -
OptionParser
# to _ a -> [String] (8.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", " -h, --h...