Changeset 1225
- Timestamp:
- 2000-06-21T10:27:17+12:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/parsargv.pm
r537 r1225 70 70 my %option; 71 71 72 # if the last argument is the string "allow_extra_options" then options 73 # in \@_ without a corresponding SPEC will be ignored (i.e. the "$arg is 74 # not a valid option" error won't occur)\n"; 75 my $allow_extra_options = pop @_; 76 if (defined ($allow_extra_options)) { 77 if ($allow_extra_options eq "allow_extra_options") { 78 $allow_extra_options = 1; 79 } else { 80 # put it back where we got it 81 push (@_, $allow_extra_options); 82 $allow_extra_options = 0; 83 } 84 } else { 85 $allow_extra_options = 0; 86 } 87 72 88 while (($spec, $var) = splice(@_, 0, 2)) 73 89 { … … 126 142 &process_arg($option{$arg}, $arglist, \$errors); 127 143 } 128 els e144 elsif (!$allow_extra_options) 129 145 { 130 146 print STDERR "$arg is not a valid option.\n";
Note:
See TracChangeset
for help on using the changeset viewer.