1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

optparse.rb: [DOC] fix keys

* lib/optparse.rb (getopts): [DOC] parameter keys are strings, not
  symbols.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-07-21 08:31:47 +00:00
parent c4dfd0ccfb
commit 5f534b7d46

View file

@ -1653,11 +1653,11 @@ XXX
# Wrapper method for getopts.rb.
#
# params = ARGV.getopts("ab:", "foo", "bar:", "zot:Z;zot option")
# # params[:a] = true # -a
# # params[:b] = "1" # -b1
# # params[:foo] = "1" # --foo
# # params[:bar] = "x" # --bar x
# # params[:zot] = "z" # --zot Z
# # params["a"] = true # -a
# # params["b"] = "1" # -b1
# # params["foo"] = "1" # --foo
# # params["bar"] = "x" # --bar x
# # params["zot"] = "z" # --zot Z
#
def getopts(*args)
argv = Array === args.first ? args.shift : default_argv