[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] Getopt::Declare 1.23

gga

3/21/2007 8:47:00 PM

This is mainly a bug fix release.

What's Getopt::Declare?

It is yet another command-line parser, that uses regular expressions
in its engine. It is designed to be extremely easy to use, but very
powerful.

Example:

require "Getopt/Declare"
args = Getopt::Declare.new(<<'EOF')

-q, --quiet quiet
-f, --files <files:if>... input files
-n, --number <num:n> a float number
-i, --integer <num:i> an integer number

EOF

p args['-q']
p args['-f']
p args.unused


For more information:

http://getoptdeclare.ruby...


What's new:

1.23 - * Added all samples as Ruby unit tests, which lead to the
discovery
of some bugs.
* Fixed silly bug with foundid that would make some parsing not
work (required parameters).
* Fixed a silly bug when parsing from a string file, which
would
modify the string in place
* Fixed a bug in that would make it not parse Rh+ and Rh- in
cmdline_pvttype demo and other potential regexes.
* Removed 3 warnings from parsing multiple times.
* Fixed a bug with cluster: singles not working.
* Fixed a stack trace bug with optional single text arguments.
* Improved handling of optional integer/float arguments,
leaving
them as nil instead of 0 as before.
* Added 'used' function to allow returning the flags that are
used.
* Made CSV demo work again, albeit I am not too happy with the
regex.

1 Answer

Duane Johnson

3/21/2007 10:50:00 PM

0

Neat-o. Thanks, gga. I learned something new from your example code
too... that having a closing paren around the start of a heredoc
string is OK. Cool!

Duane Johnson
http://blog.inquir...

On Mar 21, 2007, at 2:50 PM, gga wrote:

> This is mainly a bug fix release.
>
> What's Getopt::Declare?
>
> It is yet another command-line parser, that uses regular expressions
> in its engine. It is designed to be extremely easy to use, but very
> powerful.
>
> Example:
>
> require "Getopt/Declare"
> args = Getopt::Declare.new(<<'EOF')
>
> -q, --quiet quiet
> -f, --files <files:if>... input files
> -n, --number <num:n> a float number
> -i, --integer <num:i> an integer number
>
> EOF
>
> p args['-q']
> p args['-f']
> p args.unused
>
>
> For more information:
>
> http://getoptdeclare.ruby...
>
>
> What's new:
>
> 1.23 - * Added all samples as Ruby unit tests, which lead to the
> discovery
> of some bugs.
> * Fixed silly bug with foundid that would make some parsing not
> work (required parameters).
> * Fixed a silly bug when parsing from a string file, which
> would
> modify the string in place
> * Fixed a bug in that would make it not parse Rh+ and Rh- in
> cmdline_pvttype demo and other potential regexes.
> * Removed 3 warnings from parsing multiple times.
> * Fixed a bug with cluster: singles not working.
> * Fixed a stack trace bug with optional single text arguments.
> * Improved handling of optional integer/float arguments,
> leaving
> them as nil instead of 0 as before.
> * Added 'used' function to allow returning the flags that are
> used.
> * Made CSV demo work again, albeit I am not too happy with the
> regex.
>
>