Skip to content
No description, website, or topics provided.
C Ruby
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
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"}
You can’t perform that action at this time.