1N/A# $Id: newgetopt.pl,v 1.18 2001-09-21 15:34:59+02 jv Exp $
1N/A
1N/A# This library is no longer being maintained, and is included for backward
1N/A# compatibility with Perl 4 programs which may require it.
1N/A# It is now just a wrapper around the Getopt::Long module.
1N/A#
1N/A# In particular, this should not be used as an example of modern Perl
1N/A# programming techniques.
1N/A#
1N/A# Suggested alternative: Getopt::Long
1N/A
1N/A{ package newgetopt;
1N/A
1N/A # Values for $order. See GNU getopt.c for details.
1N/A $REQUIRE_ORDER = 0;
1N/A $PERMUTE = 1;
1N/A $RETURN_IN_ORDER = 2;
1N/A
1N/A # Handle POSIX compliancy.
1N/A if ( defined $ENV{"POSIXLY_CORRECT"} ) {
1N/A $autoabbrev = 0; # no automatic abbrev of options (???)
1N/A $getopt_compat = 0; # disallow '+' to start options
1N/A $option_start = "(--|-)";
1N/A $order = $REQUIRE_ORDER;
1N/A $bundling = 0;
1N/A $passthrough = 0;
1N/A }
1N/A else {
1N/A $autoabbrev = 1; # automatic abbrev of options
1N/A $getopt_compat = 1; # allow '+' to start options
1N/A $option_start = "(--|-|\\+)";
1N/A $order = $PERMUTE;
1N/A $bundling = 0;
1N/A $passthrough = 0;
1N/A }
1N/A
1N/A # Other configurable settings.
1N/A $debug = 0; # for debugging
1N/A $ignorecase = 1; # ignore case when matching options
1N/A $argv_end = "--"; # don't change this!
1N/A}
1N/A
1N/Ause Getopt::Long;
1N/A
1N/A################ Subroutines ################
1N/A
1N/Asub NGetOpt {
1N/A
1N/A $Getopt::Long::debug = $newgetopt::debug
1N/A if defined $newgetopt::debug;
1N/A $Getopt::Long::autoabbrev = $newgetopt::autoabbrev
1N/A if defined $newgetopt::autoabbrev;
1N/A $Getopt::Long::getopt_compat = $newgetopt::getopt_compat
1N/A if defined $newgetopt::getopt_compat;
1N/A $Getopt::Long::option_start = $newgetopt::option_start
1N/A if defined $newgetopt::option_start;
1N/A $Getopt::Long::order = $newgetopt::order
1N/A if defined $newgetopt::order;
1N/A $Getopt::Long::bundling = $newgetopt::bundling
1N/A if defined $newgetopt::bundling;
1N/A $Getopt::Long::ignorecase = $newgetopt::ignorecase
1N/A if defined $newgetopt::ignorecase;
1N/A $Getopt::Long::ignorecase = $newgetopt::ignorecase
1N/A if defined $newgetopt::ignorecase;
1N/A $Getopt::Long::passthrough = $newgetopt::passthrough
1N/A if defined $newgetopt::passthrough;
1N/A
1N/A &GetOptions;
1N/A}
1N/A
1N/A################ Package return ################
1N/A
1N/A1;
1N/A
1N/A################ End of newgetopt.pl ################