Skip to content

mttech/mruby-getopts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published