my $declaresubs = "sub wanted;\n";
my %init = ();
my ($follow_in_effect,$Skip_And) = (0,0);
+my $print_needed = 1;
while (@ARGV) {
$_ = shift;
$out .= tab . "-$filetest _";
} elsif ($_ eq 'print') {
$out .= tab . 'print("$name\n")';
+ $print_needed = 0;
} elsif ($_ eq 'print0') {
$out .= tab . 'print("$name\0")';
+ $print_needed = 0;
} elsif ($_ eq 'fstype') {
my $type = shift;
$out .= tab;
$declaresubs .= "sub doexec (\$\@);\n";
$init{doexec} = 1;
}
+ $print_needed = 0;
} elsif ($_ eq 'ok') {
my @cmd = ();
while (@ARGV && $ARGV[0] ne ';')
{ local $" = "','"; $out .= "doexec(1, '@cmd')"; }
$declaresubs .= "sub doexec (\$\@);\n";
$init{doexec} = 1;
+ $print_needed = 0;
} elsif ($_ eq 'prune') {
$out .= tab . '($File::Find::prune = 1)';
} elsif ($_ eq 'xdev') {
$out .= tab . "ls";
$declaresubs .= "sub ls ();\n";
$init{ls} = 1;
+ $print_needed = 0;
} elsif ($_ eq 'tar') {
die "-tar must have a filename argument\n" unless @ARGV;
my $file = shift;
}
}
+if ($print_needed) {
+ $out .= "\n" . tab . '&& print("$name\n")';
+}
+
print <<"END";
$startperl
=item C<-print>
-Print out path of file (always true).
+Print out path of file (always true). If none of C<-exec>, C<-ls>,
+C<-print0>, or C<-ok> is specified, then C<-print> will be added
+implicitly.
=item C<-print0>