No description, website, or topics provided.
C Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
mrblib
src
test
README.md
mrbgem.rake

README.md

Getopts

This module provides getopts to parse command line arguments.

Usage

To parse arguments in ARGV:

hash = Getopts.getopts(optstring, longopts)

To parse arguments stored in any array:

ary = []
class << ary; include Getopts; end
hash = ary.getopts(optstring, longopts)

Example

# ARGV = ["--verbose", "-c", "foo", "--add=bar"]

hash = Getopts.getopts('c:d', "verbose", "add:", "hoge:piyo")

# => {"verbose"=>"", "c"=>"foo", "add"=>"bar", "hoge"=>"piyo"}