るりまサーチ

最速Rubyリファレンスマニュアル検索!
36件ヒット [1-36件を表示] (0.141秒)

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. psych end_sequence

ライブラリ

キーワード

検索結果

OptionParser#help -> String (24233.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, --[n...

OptionParser#to_s -> String (12133.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, --[n...

OptionParser#separator(sep) -> () (9132.0)

サマリにオプションを区切るための文字列 sep を挿入します。 オプションにいくつかの種類がある場合に、サマリがわかりやすくなります。

...list[][ruby]{
require 'optparse'
opts = OptionParser.new
opts.banner = "Usage: example.rb [options]"

opts.separator ""
opts.separator "Specific options:"

opts.on("-r", "--require LIBRARY") do |lib|
options.library << lib
end


opts.separator ""
opts.separator "Common options:"

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

//}...