Thanks, Johan. I won't bother submitting my module then. I will use it internally until you release the enhanced Getopt::Long, which I very much look forward to using.
Ivan On Tue, May 14, 2002 at 09:09:33PM +0200, Johan Vromans wrote: > Hi Ivan, > > [Quoting Ivan Neulander, on May 14 2002, 11:48, in "Re: registration"] > > > I have a new version (no release dates, yet) of Getopt::Long in > > > development that allows option specs like "beta=s" (as usual, exactly one), > > > "bozo=s{0,1}" (none or one), "mail=s{1,}" (one or more) and so on. > > > > That would be useful. Now how about allowing whitespace to separate > > the args? That would pretty much cover it. :) > > "mail=s{1,}" is the spec, meaning "take one more strings". On > the command line, that would mean > > -mail arg1 arg2 ... > > > Actually, I have a control variable "$spill" that causes any excess > > Ah! > > > args for any flag to be interpreted as non-flag args. This setting is > > off by default (and perhaps it shouldn't be), but if you turn it on, > > you will never get an error about too many args. > > Yes, I think this would be the default. > > > In general, the use whitespace separated flag arguments is very common > > where I work, but perhaps not so elsewhere. I thought it might be a > > useful option to consider as a public module. Since it is implemented > > on top of (and therefore 'use's Getopt::Long), I would very much > > appreciate your feedback. > > Well, as I said, I have a development version of Getopt::Long that > does exactly this, and more. For example "color=s(red,yellow,blue){1,3}" > would allow the command line argument -color to take one to three > arguments of the set "red", "yellow" and "blue". Likewise, > "rgb=i(0..255){3}" allows command line arg -rgb to take exactly three > numbers between 0 and 255. > > However, since I also allow options to take optional arguments the > semantics and implementations become very complex. For example, with > "rgb:i(0.255){3}" allows -rgb 127 250 321 but will assign two values > to rgb because the third is 'out of range' and hence interpreted as a > non-flag args. > > -- Johan -- ---------------------------------------------- Ivan Neulander (310) 448-7689 Programmer [EMAIL PROTECTED] R H Y T H M & H U E S S T U D I O S