るりまサーチ

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

別のキーワード

  1. string []=
  2. string []
  3. string slice
  4. string slice!
  5. string gsub

クラス

キーワード

検索結果

OptionParser#help -> String (18212.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, -...

OptionParser#to_s -> String (3112.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, -...

OptionParser#summary_indent -> String (122.0)

サマリを表示する時のインデントを文字列で返します。

...例][ruby]{
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_ind...
...ent = " "
opts.summary_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
//}...

OptionParser#to_a -> [String] (116.0)

サマリの各行を要素とした配列を返します。

...を返します。

//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.to_a # => ["Usage: test [options]", " -i, --init\n", " -u, --update\n", " -h, --help\n"]
//}...

OptionParser#parse(*args) -> [String] (111.0)

与えられた argv をパースします。 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) # => ["tes...

絞り込み条件を変える

OptionParser#parse(*args, into: nil) -> [String] (111.0)

与えられた argv をパースします。 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) # => ["tes...

OptionParser#parse(argv) -> [String] (111.0)

与えられた argv をパースします。 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) # => ["tes...

OptionParser#parse(argv, into: nil) -> [String] (111.0)

与えられた argv をパースします。 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) # => ["tes...

OptionParser#parse!(argv = self.default_argv) -> [String] (110.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) # => ["t...

OptionParser#parse!(argv = self.default_argv, into: nil) -> [String] (110.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) # => ["t...

絞り込み条件を変える