24件ヒット
[1-24件を表示]
(0.017秒)
ライブラリ
- optparse (24)
クラス
- OptionParser (24)
検索結果
-
OptionParser
# on _ tail(*arg , &block) -> self (18125.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
# separator(sep) -> () (12.0) -
サマリにオプションを区切るための文字列 sep を挿入します。 オプションにいくつかの種類がある場合に、サマリがわかりやすくなります。
...= "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
//}...