in reply to Wrapper headache - Getopt::Long screw up w/ '--' and missing opt value
I really don't use Getopt::Long very often, but the docs seemed pretty clear to me...
= type [ desttype ] The option requires an argument of the given type. Supported types are: s String. An arbitrary sequence of characters. It is valid for the argument to start with "-" or "--".
If you want your debug option to take an optional argument, you can specify that with a colon instead of an equals; i.e. 'debug:s' rather than 'debug=s'.
How do people cope when writing a a Perl wrapper which accepts known & unkwon options for the wrapped program?
Have you looked at how to use Getopt::Long::Configure() to configure Getopt::Long's behavior? It seems that you can use Getopt::Long::Configure('pass_through') to tell Getopt::Long to leave unknown options in @ARGV. You might want to use it with Getopt::Long::Configure('require_order') or Getopt::Long::Configure('permute') as well.
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Wrapper headache - Getopt::Long screw up w/ '--' and missing opt value
by parv (Parson) on Feb 10, 2003 at 04:25 UTC |