in reply to Re: Passing Options
in thread Passing Options
check Getopt::Long!I just did. I cannot find anywhere how to tell Getopt::Long to parse the command line as wished.
That requires multiple -t, -b and -r arguments. From a command line ofGetOptions( 't=s' => \ our $target, 'b=s' => \ our $buildtype, 'r=s' => \ @releases );
it will put foo in @releases, dog in $buildtype, pony in $target, and leave the rest in @ARGV.-r foo bar baz -b dog cat -t pony
Not at all as wished.use Getopt::Long; our @releases; GetOptions( 't=s' => \ our $target, 'b=s' => \ our $buildtype, 'r=s' => \ @releases ); print "Target: $target\n"; print "Buildtype: $buildtype\n"; print "Releases: @releases\n"; print "ARGV: @ARGV\n"; __END__ Target: pony Buildtype: dog Releases: foo ARGV: bar baz cat
I don't know any module that will parse the command line as was wished, but it shouldn't be too hard to roll your own.
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Passing Options
by fruiture (Curate) on Aug 12, 2002 at 15:33 UTC | |
by Abigail-II (Bishop) on Aug 12, 2002 at 15:59 UTC | |
by fruiture (Curate) on Aug 12, 2002 at 21:59 UTC |