| Short description: |
Easy command-line option parser. |
| Category: |
Library/Utility |
| Status: |
stable |
| Created: |
2004-01-01 14:33:38 GMT |
| Last update: |
2004-01-01 14:33:37 GMT |
| Owner: |
Shirai,Kaoru
(Projects of this owner) |
| Homepage: |
http://devel.korinkan.co.jp/ruby-ropt/ |
| Download: |
http://devel.korinkan.co.jp/ruby-ropt/ropt-0.1.0.tar.gz
|
| License: |
Ruby's |
| Dependency: |
|
| Description: |
-- Homepage and document are JAPANESE ONLY now. --
ropt is command-line option parser for Ruby, easy but useful enough.
example:
----------------------------------------------------------------------------
opt = ROpt.parse(ARGV, "ab:c::", "long-a", "long-b:", "long-c::") || usage
puts("-a specified.") if opt[:a]
puts("-b is #{opt[:b].inspect}") if opt[:b]
puts("-c are #{opt[:c].inspect}") unless opt[:c].empty?
puts("--long-a specified.") if opt['long-a']
puts("--long-b is #{opt['long-b'].inspect}") if opt['long-b']
puts("--long-c are #{opt['long-c'].inspect}") unless opt['long-c'].empty?
puts("Rest arguments: #{opt.args.inspect}") unless opt.args.empty?
----------------------------------------------------------------------------
|