p - Don't ask for command when finished, exit directly
This commit is contained in:
parent
bd5a149cc0
commit
61efff731f
4
p
4
p
@ -27,19 +27,21 @@ sub printfile {
|
|||||||
print;
|
print;
|
||||||
&evalcmd unless ++$lines % $pagesize;
|
&evalcmd unless ++$lines % $pagesize;
|
||||||
}
|
}
|
||||||
&evalcmd;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unshift(@ARGV, '-') unless @ARGV;
|
unshift(@ARGV, '-') unless @ARGV;
|
||||||
|
|
||||||
|
my $n = $#ARGV;
|
||||||
for (@ARGV) {
|
for (@ARGV) {
|
||||||
if (/^-$/) {
|
if (/^-$/) {
|
||||||
&printfile(\*STDIN);
|
&printfile(\*STDIN);
|
||||||
|
&evalcmd if $n--;
|
||||||
} elsif (/^-(\d+)$/) {
|
} elsif (/^-(\d+)$/) {
|
||||||
$pagesize = $1;
|
$pagesize = $1;
|
||||||
} else {
|
} else {
|
||||||
open(my $fh, '<', $_) or die "$0: Cannot open $_ for reading: $!";
|
open(my $fh, '<', $_) or die "$0: Cannot open $_ for reading: $!";
|
||||||
&printfile($fh);
|
&printfile($fh);
|
||||||
|
&evalcmd if $n--;
|
||||||
close($fh);
|
close($fh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user