るりまサーチ

最速Rubyリファレンスマニュアル検索!
117件ヒット [1-100件を表示] (0.018秒)
トップページ > クエリ:Hash[x] > クエリ:optparse[x]

別のキーワード

  1. _builtin hash
  2. hash []
  3. matrix hash
  4. dbm to_hash
  5. _builtin to_hash

検索結果

<< 1 2 > >>

optparse (38192.0)

コマンドラインのオプションを取り扱うためのライブラリです。

...コマンドラインのオプションを取り扱うためのライブラリです。

=== チュートリアル

optparse
を使う場合、基本的には

(1) OptionParser オブジェクト opt を生成する。
(2) オプションを取り扱うブロックを opt に登録する。
(3) o...
...ョンの定義

以下はオプション -a, -b を受け付けるコマンドを作成する例です。

//emlist[sample.rb][ruby]{
require 'optparse'
opt = OptionParser.new

opt.on('-a') {|v| p v }
opt.on('-b') {|v| p v }

opt.parse!(ARGV)
p ARGV
//}

ruby sample.rb -a foo bar -b baz...
...す。

//emlist[subcom.rb][ruby]{
#! /usr/bin/ruby
# contributed by Minero Aoki.

require 'optparse'

parser = OptionParser.new
parser.on('-i') { puts "-i" }
parser.on('-o') { puts '-o' }

subparsers = Hash.new {|h,k|
$stderr.puts "no such subcommand: #{k}"
exit 1
}
subparsers['add'] = OptionPa...

OptionParser::Arguable#getopts(short_opt, *long_opt) -> Hash (8123.0)

指定された short_opt や long_opt に応じて自身をパースし、結果を Hash として返します。

...指定された short_opt や long_opt に応じて自身をパースし、結果を Hash として返します。

コマンドラインに - もしくは -- を指定した場合、それ以降の解析を行ないません。

@param short_opt ショートネームのオプション(-f や -fx)...
...実際は OptionParser::ParseError のサブク
ラスの例外になります。

//emlist[t.rb][ruby]{
require 'optparse'
params = ARGV.getopts("ab:", "foo", "bar:", "bufsize:1024")
p params
//}

# 実行結果
$ ruby t.rb -b 1 --foo --bar xxx -- -a
{"bufsize"=>...

OptionParser#getopts(*opts) -> Hash (8118.0)

引数をパースした結果を、Hash として返します。

...引数をパースした結果を、Hash として返します。

配列 argv を与えた場合、argv をパースします。そうでない場合は、
default_argv をパースします。

//emlist[][ruby]{
opt = OptionParser.new
params = opt.getopts(ARGV, "ab:", "foo", "bar:")
# params["a"]...

OptionParser#getopts(argv, *opts) -> Hash (8118.0)

引数をパースした結果を、Hash として返します。

...引数をパースした結果を、Hash として返します。

配列 argv を与えた場合、argv をパースします。そうでない場合は、
default_argv をパースします。

//emlist[][ruby]{
opt = OptionParser.new
params = opt.getopts(ARGV, "ab:", "foo", "bar:")
# params["a"]...

OptionParser.getopts(*opts) -> Hash (8118.0)

引数をパースした結果を、Hash として返します。(self.new.getopts と同じです)

...引数をパースした結果を、Hash として返します。(self.new.getopts と同じです)

@param argv パースしたい配列を指定します。

@param opts 引数を文字列で指定します。

@raise OptionParser::ParseError パースに失敗した場合、発生します。...

絞り込み条件を変える

OptionParser.getopts(argv, *opts) -> Hash (8118.0)

引数をパースした結果を、Hash として返します。(self.new.getopts と同じです)

...引数をパースした結果を、Hash として返します。(self.new.getopts と同じです)

@param argv パースしたい配列を指定します。

@param opts 引数を文字列で指定します。

@raise OptionParser::ParseError パースに失敗した場合、発生します。...

OptionParser (8012.0)

コマンドラインのオプションを取り扱うためのクラスです。

...rse(ARGV) でコマンドラインを実際に parse する。

というような流れになります。

//emlist[][ruby]{
require "optparse"
ProgramConfig = Hash.new
opts = OptionParser.new
opts.on("-a"){|v| ProgramConfig[:a] = true } # オプション「-a」がコマンドラインで指定さ...

MiniTest::Unit#process_args(args = []) -> Hash (123.0)

optparse を使ってコマンドライン引数を解析した結果を返します。

...
optparse
を使ってコマンドライン引数を解析した結果を返します。

@param args コマンドライン引数を指定します。

@see optparse...

NEWS for Ruby 3.0.0 (72.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ob and Dir.[] now sort the results by default, and accept the `sort:` keyword option. 8709
* ENV
* ENV.except has been added, which returns a hash excluding the given keys and their values. 15822
* Windows: Read ENV names and values as UTF-8 encoded Strings 12650
* Encoding
* Added...
...cant overhead to major collections, so please test first! 17176
* Hash
* Hash#transform_keys and Hash#transform_keys! now accept a hash that maps keys to new keys. 16274
* Hash#except has been added, which returns a hash excluding the given keys and their values. 15822
* IO
* IO#n...
...* drb
* debug
* erb
* find
* net-ftp
* net-http
* net-imap
* net-protocol
* open-uri
* optparse
* pp
* prettyprint
* resolv-replace
* resolv
* rinda
* set
* securerandom
* shellwords
* t...

ruby 1.8.4 feature (60.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

...re/set_trace_func [bug]>))
* ((<ruby 1.8.4 feature/set_trace_func [change]>))
* ((<ruby 1.8.4 feature/printf [bug]>))
* ((<ruby 1.8.4 feature/Hash [bug]>))
* ((<ruby 1.8.4 feature/test [bug]>))
* ((<ruby 1.8.4 feature/File.identical? [new]>))
* ((<ruby 1.8.4 feature/FileTest.identical? [...
...at]>))
* ((<ruby 1.8.4 feature/TCPSocket#initialize [bug]>))
* ((<ruby 1.8.4 feature/TCPServer#initialize [bug]>))
* ((<ruby 1.8.4 feature/"optparse">))
* ((<ruby 1.8.4 feature/"find">))
* ((<ruby 1.8.4 feature/Iconv>))
* ((<ruby 1.8.4 feature/WEBrick::Config::FileHandler [compat]>))
*...
...きる最大値は 2147483647 です。
# -e:1:in `printf': width too big (ArgumentError)

: Hash [bug]

#Wed Nov 23 03:40:49 2005 Guy Decoux <ts@moulon.inra.fr>
#
# * re.c (KR_REHASH): should cast to unsigned for 64bit CPU.
# [ruby-core:06721]

sizeof(long) > sizeof(int)...

絞り込み条件を変える

<< 1 2 > >>