るりまサーチ

最速Rubyリファレンスマニュアル検索!
55件ヒット [1-55件を表示] (0.032秒)
トップページ > クエリ:self[x] > クエリ:on_tail[x]

別のキーワード

  1. optparse on
  2. optionparser on
  3. tracer on
  4. thread abort_on_exception
  5. thread abort_on_exception=

ライブラリ

クラス

キーワード

検索結果

OptionParser#on_tail(*arg, &block) -> self (18220.0)

オプションを取り扱うためのブロックを自身の持つリストの最後に登録します。

...")
opts.on_tail("-h", "--help")
end

puts opts.help

# => Usage: test [options]
# -i, --init
# -u, --update
# -h, --help
//}

//emlist[例][ruby]{
require "optparse"

opts = OptionParser.new
opts.on_tail("-h", "--help", "Show this message") do
puts opts
exit
end

opts.on_tail("--versi...

OptionParser#summarize(to = [], width = self.summary_width, max = width - 1, indent= self.summary_indent) -> () (210.0)

サマリを指定された to へと加えていきます。

...

//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.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summarize(["description\n"], 10, 8, "...

OptionParser#summarize(to = [], width = self.summary_width, max = width - 1, indent= self.summary_indent) {|line| ... } -> () (210.0)

サマリを指定された to へと加えていきます。

...

//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.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summarize(["description\n"], 10, 8, "...

OptionParser#on_head(*arg, &block) -> self (113.0)

オプションを取り扱うためのブロックを自身の持つリストの最初に登録します。

...][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
//}

@see OptionParser#on, OptionParser#on_tail...

OptionParser#parse!(argv = self.default_argv) -> [String] (107.0)

与えられた 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"]
ARGV # => ["-i", "-u", "-h", "...

絞り込み条件を変える

OptionParser#parse!(argv = self.default_argv, into: nil) -> [String] (107.0)

与えられた 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"]
ARGV # => ["-i", "-u", "-h", "...