Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pr: more compatible -h option #791

Merged
merged 1 commit into from
Nov 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions bin/pr
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ my $offsetspaces=0; # chars at beginning of line (Char/Bool)
my $doublespace=0; # whether to double space
my $number=0; # number the lines; how high? (Int/Bool)
my $startpageno=1; # starting page no
my $header=""; # optional header text (String/Bool)
my $header; # optional header text (String/Bool)
my $formfeed=0; # Use formfeeds instead of spaces. (Bool)
my $quietskip=0; # Ignore unopened files (Bool)
my $column_sep=""; # specified column separator (Bool/Char)
Expand Down Expand Up @@ -119,7 +119,7 @@ while (@ARGV && $ARGV[0] =~ /^-(.+)/ && (shift, ($_ = $1), 1)) {
}

if (s/^h//) {
warn "-h option already used" if $header;
warn "-h option already used" if defined $header;
$header=shift;
redo OPTION;
}
Expand Down Expand Up @@ -246,8 +246,6 @@ sub checknum {
}

sub create_col {
my($col)=@_;

my $pagelen=$length-($trailerlength*2);
if ($pagelen <= 0) {
$trailer = 0;
Expand Down Expand Up @@ -313,7 +311,7 @@ sub print_header {
print ' ' x $offsetspaces if $offsetspaces;
print scalar(localtime), " ";

if ($header) {
if (defined $header) {
print "$header ";
} else {
if (! $multimerge) {
Expand Down
Loading