Insure that installed C header files are world-readable
[p5sagit/p5-mst-13.2.git] / lib / newgetopt.pl
CommitLineData
01e8c204 1# newgetopt.pl -- new options parsing.
2# Now just a wrapper around the Getopt::Long module.
3# $Id: newgetopt.pl,v 1.15 1995/12/26 14:57:33 jv Exp $
352d5a3a 4
ee0007ab 5{ package newgetopt;
ee0007ab 6
01e8c204 7 # Values for $order. See GNU getopt.c for details.
8 $REQUIRE_ORDER = 0;
9 $PERMUTE = 1;
10 $RETURN_IN_ORDER = 2;
11
12 # Handle POSIX compliancy.
13 if ( defined $ENV{"POSIXLY_CORRECT"} ) {
14 $autoabbrev = 0; # no automatic abbrev of options (???)
15 $getopt_compat = 0; # disallow '+' to start options
16 $option_start = "(--|-)";
17 $order = $REQUIRE_ORDER;
ee0007ab 18 }
01e8c204 19 else {
20 $autoabbrev = 1; # automatic abbrev of options
21 $getopt_compat = 1; # allow '+' to start options
22 $option_start = "(--|-|\\+)";
23 $order = $PERMUTE;
ee0007ab 24 }
25
01e8c204 26 # Other configurable settings.
27 $debug = 0; # for debugging
28 $ignorecase = 1; # ignore case when matching options
29 $argv_end = "--"; # don't change this!
30}
352d5a3a 31
01e8c204 32use Getopt::Long;
352d5a3a 33
01e8c204 34################ Subroutines ################
352d5a3a 35
01e8c204 36sub NGetOpt {
352d5a3a 37
01e8c204 38 $Getopt::Long::debug = $newgetopt::debug
39 if defined $newgetopt::debug;
40 $Getopt::Long::autoabbrev = $newgetopt::autoabbrev
41 if defined $newgetopt::autoabbrev;
42 $Getopt::Long::getopt_compat = $newgetopt::getopt_compat
43 if defined $newgetopt::getopt_compat;
44 $Getopt::Long::option_start = $newgetopt::option_start
45 if defined $newgetopt::option_start;
46 $Getopt::Long::order = $newgetopt::order
47 if defined $newgetopt::order;
48 $Getopt::Long::ignorecase = $newgetopt::ignorecase
49 if defined $newgetopt::ignorecase;
50
51 &GetOptions;
52}
352d5a3a 53
01e8c204 54################ Package return ################
352d5a3a 55
352d5a3a 561;
01e8c204 57
58################ End of newgetopt.pl ################