Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.9 KiB

  1. # newgetopt.pl -- new options parsing.
  2. # Now just a wrapper around the Getopt::Long module.
  3. # $Id: newgetopt.pl,v 1.17 1996-10-02 11:17:16+02 jv Exp $
  4. { package newgetopt;
  5. # Values for $order. See GNU getopt.c for details.
  6. $REQUIRE_ORDER = 0;
  7. $PERMUTE = 1;
  8. $RETURN_IN_ORDER = 2;
  9. # Handle POSIX compliancy.
  10. if ( defined $ENV{"POSIXLY_CORRECT"} ) {
  11. $autoabbrev = 0; # no automatic abbrev of options (???)
  12. $getopt_compat = 0; # disallow '+' to start options
  13. $option_start = "(--|-)";
  14. $order = $REQUIRE_ORDER;
  15. $bundling = 0;
  16. $passthrough = 0;
  17. }
  18. else {
  19. $autoabbrev = 1; # automatic abbrev of options
  20. $getopt_compat = 1; # allow '+' to start options
  21. $option_start = "(--|-|\\+)";
  22. $order = $PERMUTE;
  23. $bundling = 0;
  24. $passthrough = 0;
  25. }
  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. }
  31. use Getopt::Long;
  32. ################ Subroutines ################
  33. sub NGetOpt {
  34. $Getopt::Long::debug = $newgetopt::debug
  35. if defined $newgetopt::debug;
  36. $Getopt::Long::autoabbrev = $newgetopt::autoabbrev
  37. if defined $newgetopt::autoabbrev;
  38. $Getopt::Long::getopt_compat = $newgetopt::getopt_compat
  39. if defined $newgetopt::getopt_compat;
  40. $Getopt::Long::option_start = $newgetopt::option_start
  41. if defined $newgetopt::option_start;
  42. $Getopt::Long::order = $newgetopt::order
  43. if defined $newgetopt::order;
  44. $Getopt::Long::bundling = $newgetopt::bundling
  45. if defined $newgetopt::bundling;
  46. $Getopt::Long::ignorecase = $newgetopt::ignorecase
  47. if defined $newgetopt::ignorecase;
  48. $Getopt::Long::ignorecase = $newgetopt::ignorecase
  49. if defined $newgetopt::ignorecase;
  50. $Getopt::Long::passthrough = $newgetopt::passthrough
  51. if defined $newgetopt::passthrough;
  52. &GetOptions;
  53. }
  54. ################ Package return ################
  55. 1;
  56. ################ End of newgetopt.pl ################