my $publish_rejections_patfile= '/dev/null';
my $publish_rejections= 0;
-if ($ARGV[0] eq '-P') {
- $publish_rejections= 1;
- shift @ARGV;
-} elsif ($ARGV[0] =~ s/^\-P//) {
- $publish_rejections= 1;
- $publish_rejections_patfile= shift @ARGV;
+
+for (;;) {
+ last unless @ARGV;
+ last unless $ARGV[0] =~ m/^-/;
+ $_ = shift @ARGV;
+ last if m/^--?$/;
+ while (m/^-./) {
+ if (s/^-P(.*)$//) {
+ $publish_rejections= 1;
+ $publish_rejections_patfile= $1 if length $1;
+ } else {
+ die "bad option $_ ?";
+ }
+ }
}
our ($how) = @_;