Re: Parms With Ranges
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: Parms With Ranges

From: Juan C. Gil <jgil@gmv.es>
Date: Mon Feb 27 2006 - 10:42:33 CET

gamename wrote:
> Hi,
>
> Anyone have any code that can work with ranges of values passed to a
> script? For example:
>
> foo.tcl -range "1-9,11,13,19"
>
> Where :
>
> "foo.tcl" is the script
> "-range" is the parm
> "1-9,11,13,19" is the ranges of values to be used. In this case, it
> would be from 1 to 9, exclude 10, include 11, exclude 12, include 13,
> exclude everything up to 18, and then lastly include 19.
>
> TIA,
> -T

The Simple Development Library (http://simpledevlib.sourceforge.net/)
provides a command line processor which allows ranged numerical
arguments among other goodies.

You would declare a program as having an option -range as follows:
   -range -type integer-range -description {a range of numbers}
and use it from the command line like this:
   foo.tcl -range 1:9,11,13,19

Juan Carlos---
Received on Sun Apr 30 02:16:41 2006