るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.069秒)
トップページ > クエリ:l[x] > クエリ:>[x] > クエリ:to_s[x] > ライブラリ:optparse[x]

別のキーワード

  1. _builtin >
  2. bigdecimal >
  3. float >
  4. module >
  5. complex >

クラス

検索結果

OptionParser#to_s -> String (18203.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...
..., --[no-]verbose Run verbosely
//}...

OptionParser#help -> String (6203.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...
..., --[no-]verbose Run verbosely
//}...