220件ヒット
[1-100件を表示]
(0.038秒)
別のキーワード
種類
- インスタンスメソッド (176)
- クラス (22)
- ライブラリ (12)
- 文書 (10)
ライブラリ
- getoptlong (11)
- optparse (176)
クラス
- GetoptLong (11)
- OptionParser (165)
キーワード
-
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (4) - OptionParser (11)
- Options (11)
-
on
_ head (11) -
on
_ tail (11) - parse (22)
- parse! (11)
-
rubygems
/ commands / specification _ command (11) - separator (11)
- summarize (22)
-
summary
_ indent (11) -
summary
_ indent= (11) -
summary
_ width (11) -
summary
_ width= (11) -
test
/ unit (1) -
to
_ a (11) -
to
_ s (11)
検索結果
先頭5件
-
OptionParser
# help -> String (21213.0) -
サマリの文字列を返します。
...{
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 Ru... -
GetoptLong
# set _ options(*arguments) -> self (6218.0) -
あなたのプログラムで、認識させたいオプションをセットします。 個々のオプションは、オプション名と引数のフラグからなる配列でな ければいけません。
...フラグからなる配列でな
ければいけません。
配列中のオプション名は、一文字オプション (例: -d) か長いオプ
ション (例: --debug) を表した文字列のいずれかでなければなり
ません。配列の中の一番左端のオプション名が、......グは、GetoptLong::NO_ARGUMENT,
GetoptLong::REQUIRE_ARGUMENT, GetoptLong::OPTIONAL_ARGUMENT
のいずれかでなくてはなりません。
オプションを設定できるのは、get, get_option, each,
each_option メソッドを呼び出す前だけです。これらのメソッドを
呼び......な引数が与えられるた場合、発生します。
parser.set_options(['-d', '--debug', GetoptLong::NO_ARGUMENT],
['--version', GetoptLong::NO_ARGUMENT],
['--help', GetoptLong::NO_ARGUMENT])
オプション名と引数のフラグ... -
OptionParser
# to _ s -> String (6113.0) -
サマリの文字列を返します。
...{
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 Ru... -
rubygems
/ commands / specification _ command (6084.0) -
指定された Gem パッケージの gemspec の情報を YAML 形式で表示するためのライブラリです。
...: gem specification [GEMFILE] [options]
Options:
-v, --version VERSION Specify version of gem to examine
--platform PLATFORM Specify the platform of gem to specification
--all Output specifications for all versions of......mote Options:
-l, --local 操作をローカルに限定します
-r, --remote 操作をリモートに限定します
-b, --both ローカルとリモートの両方の操作を許可します
-B, --bulk-threshol......ジトリの URL を指定します
--[no-]http-proxy [URL] リモートの操作に HTTP プロクシを使用します
-u, --[no-]update-sources ローカルソースキャッシュを更新します
Common Options:
-h, --help このコ... -
OptionParser (6018.0)
-
コマンドラインのオプションを取り扱うためのクラスです。
...ラスです。
オプションが指定された時に呼ばれるブロックを
OptionParser#on メソッドで登録していきます。
つまり、OptionParser を使う場合、基本的には
(1) OptionParser オブジェクト opt を生成する。
(2) オプションを取り扱う......うような流れになります。
//emlist[][ruby]{
require "optparse"
ProgramConfig = Hash.new
opts = OptionParser.new
opts.on("-a"){|v| ProgramConfig[:a] = true } # オプション「-a」がコマンドラインで指定されていた場合の動作。
opts.parse!(ARGV)......: --help
オプションサマリを表示してから exit します。
: --version
OptionParser#ver を表示してから exit します。
OptionParser#ver が定義されていない場合は、そのようにエラーメッセージを出力して abort します。
オプション「--v... -
RDoc
:: Options (6012.0) -
rdoc コマンドのオプションを解析するためのクラスです。
...ptions] カスタムオプション
RDoc のジェネレータでは、RDoc::Options をフックして独自の
オプションを指定できます。
Object::ARGV に --format が含まれていた場合、RDoc はジェネ
レータ独自のオプションを解析するために setup_options......場合は --format オプションは必ず指定
する必要があります。rdoc --help を実行すると追加したオプションの一覧が
確認できます。
例:
class RDoc::Generator::Spellcheck
RDoc::RDoc.add_generator self
def self.setup_options rdoc_options
op =......rdoc_options.option_parser
op.on('--spell-dictionary DICTIONARY',
RDoc::Options::Path) do |dictionary|
# RDoc::Options に spell_dictionary アクセサの定義が必要
rdoc_options.spell_dictionary = dictionary
end
end
end... -
OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) -> () (3156.0) -
サマリを指定された to へと加えていきます。
...= 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, " ")
# => ["description\n", " -i\n", " --init......\n", " -u\n", " --update\n", " -h\n", " --help\n"]
//}... -
OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) {|line| . . . } -> () (3156.0) -
サマリを指定された to へと加えていきます。
...= 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, " ")
# => ["description\n", " -i\n", " --init......\n", " -u\n", " --update\n", " -h\n", " --help\n"]
//}... -
OptionParser
# summary _ indent -> String (3154.0) -
サマリを表示する時のインデントを文字列で返します。
...{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summary_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summary_indent = " "......opts.summary_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
//}... -
OptionParser
# summary _ width -> Integer (3154.0) -
サマリを表示するときの幅を整数で返します。
...uby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summary_width # => 32
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summary_width = 8
opts.sum......mary_width # =>8
opts.summarize
# => [" -i\n", " --init\n", " -u\n", " --update\n", " -h\n", " --help\n"]
//}...