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

nl: retire -V #593

Merged
merged 1 commit into from
May 1, 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
10 changes: 4 additions & 6 deletions bin/nl
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ my $program = basename($0);
# options
$Getopt::Std::STANDARD_HELP_VERSION = 1;
my %options = ();
getopts('Vb:d:f:h:i:n:ps:v:w:', \%options) or pod2usage(EX_FAILURE);
getopts('b:d:f:h:i:n:ps:v:w:', \%options) or pod2usage(EX_FAILURE);
my $file = shift;
$file = '-' unless defined $file;
pod2usage(EX_FAILURE) if @ARGV;

my $version = $options{V};
my $type_b = $options{b} || "t";
my $delim = $options{d} || '\:';
my $type_f = $options{f} || "n";
Expand Down Expand Up @@ -94,8 +93,8 @@ else {
$incr = 1;
}

if ($version) {
print "$program $VERSION\n";
sub VERSION_MESSAGE {
print "$program version $VERSION\n";
exit EX_SUCCESS;
}

Expand Down Expand Up @@ -264,7 +263,7 @@ nl - line numbering filter

=head1 SYNOPSIS

nl [-V] [-p] [-b type] [-d delim] [-f type] [-h type] [-i incr] [-l num]
nl [-p] [-b type] [-d delim] [-f type] [-h type] [-i incr] [-l num]
[-n format] [-s sep] [-v startnum] [-w width] [file]

=head1 DESCRIPTION
Expand All @@ -276,7 +275,6 @@ If file is a dash "-" or if no file is given as argument, nl reads from standard

The following options are supported.

-V version
-b type 'a' all lines
't' only non-empty lines (default)
'n' no numbering
Expand Down
Loading