Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
[ANN] OptionParser
Jim Freeze
6/17/2005 6:37:00 PM
CommandLine::OptionParser
=========================
Author: Jim Freeze
Copyright 2005 Jim Freeze
ABOUT
=====
CommandLine::OptionParser is part of the CommandLine suite of
tools and is used for command line parsing. The command line
parser suite consists of classes CommandLine::Option,
CommandLine::OptionData and CommandLine::Application.
The parser supports POSIX, Gnu and XTools style parsing options.
It also provides flexibility to support <em>non standard</em>
options. For example:
POSIX
=====
OptionParser.new Option.new(:posix, :names => "-f")
Gnu
===
OptionParser.new Option.new(:names => %w[--file -f])
XTools
======
OptionParser.new Option.new(:names => "-file")
User
====
OptionParser.new(Option.new(
:names => %w(--file -file --files -files -f),
:arg_arity => [1,-1],
:arg_description => "file1 [file2, ...]"))
This last option prints:
OPTIONS
--file,-file,--files,-files,-f file1 [file2, ...]
HISTORY
=======
After poking around in a few corporations, it was evident that
option parsing was not well understood. Therefore, many inhouse
tools were built that did not conform to any of the POSIX, Gnu or XTools
option styles. CommandLine::OptionParser was developed so that
new applications could be written that conformed to accepted standards,
but non-standard option configurations could be handled as well
to support legacy interfaces.
More information and usage scenarios on OptionParser can be found at:
http://rubyforge.org/projects/opt...
Download & Installation
=======================
Homepage:
http://rubyforge.org/projects/opt...
Documentation:
http://optionparser.ruby...
Download:
http://rubyforge.org/frs/?group_id=632&relea...
Dependencies:
* None
Currently optionparser is only available as a rubygem.
Via RubyGems
$ gem install -r OptionParser
All feedback is appreciated!
Installations not available yet
===============================
# not in RPA yet
Via RPA
$ rpa install optionparser
# this either
The do-it-yourself way
$ ruby setup.rb config
$ ruby setup.rb setup
$ ruby setup.rb install
# nor this
The simplified do-it-yourself way
$ rake install
RELEASE NOTES
=============
---------------------------------------------------------------------
0.5.1 06/17/2005
* Contains all planned features except CVS like command handling
* Fixed loading path using gems. Is now loaded by:
require 'rubygems'
require 'commandline/optionparser'
* Updated documentation
---------------------------------------------------------------------
0.5.0 06/07/2005
* First public release
--
Jim Freeze
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
[ANN] OptionParser
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password