On May 20, 2006, at 7:41 AM, Steffen Mueller wrote:
after yesterday's PAR 0.93 release, I decided to add a very simple
new feature: Starting with the SVN revision 104, pp accepts
filenames as parameters from which to read options.
Long command lines are a cause for concern on Windows where the
length of a command line is (severely) limited. Several users have
complained about that.
The is as follows:
pp OPTIONS... @filename MORE_OPTIONS... @file2 OPTIONS...
The options from file 'filename' and 'file2' are inserted in the
corresponding places in @ARGV for processing with Getopt::Long as
usual.
Unfortunately, this feature adds a new dependency:
Getopt::ArgvFile. What do you think? Should we accept the new
dependency, hack up something similar and inline it, or just not
offer the feature at all?
I think it sounds like a fine feature. PAR has so many dependencies
that I'm sure few would complain about one more. :-) Nevertheless,
here's a simplistic implementation to pre-process the @ARGV list:
@ARGV = map {my $fh; /\A\@(.*)/ ? open($fh, "<", $1) ?
map {split} <$fh> : die $! : $_} @ARGV;
Chris
--
Chris Dolan, Software Developer, Clotho Advanced Media Inc.
608-294-7900, fax 294-7025, 1435 E Main St, Madison WI 53703
vCard: http://www.chrisdolan.net/ChrisDolan.vcf
Clotho Advanced Media, Inc. - Creators of MediaLandscape Software
(http://www.media-landscape.com/) and partners in the revolutionary
Croquet project (http://www.opencroquet.org/)