Skip to content

Commit 1edbc9c

Browse files
authored
Merge pull request #417 from mknos/echo-question
echo: remove non-standard -?
2 parents 469f392 + 5181f2c commit 1edbc9c

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

bin/echo

+3-26
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,15 @@ package PerlPowerTools::echo;
1515

1616
use strict;
1717

18-
my ($VERSION) = '1.2';
18+
my ($VERSION) = '1.3';
1919

2020
__PACKAGE__->run( @ARGV ) unless caller();
2121

2222
sub run {
2323
my ( $self, @args ) = @_;
2424

25-
unless (@args) {
26-
print "\n";
27-
exit 0;
28-
}
29-
30-
if ($args[0] eq '-?') {
31-
print <<EOF;
32-
Usage: echo [-n] [arguments]
33-
34-
Displays the command line arguments, seperated by spaces.
35-
36-
Options:
37-
-n: Do not print a newline after the arguments.
38-
-?: Display usage information.
39-
EOF
40-
exit 0;
41-
}
42-
4325
my $N = 1;
44-
if ($args[0] eq '-n') {
26+
if (@args && $args[0] eq '-n') {
4527
$N = 0;
4628
shift @args;
4729
}
@@ -50,7 +32,6 @@ EOF
5032
print "\n" if $N == 1;
5133

5234
exit 0;
53-
5435
}
5536

5637
1;
@@ -69,7 +50,7 @@ echo [-n] [arguments...]
6950
7051
=head1 DESCRIPTION
7152
72-
echo prints the command line arguments seperated by spaces. A newline is
53+
echo prints the command line arguments separated by spaces. A newline is
7354
printed at the end unless the '-n' option is given.
7455
7556
=head2 OPTIONS
@@ -82,10 +63,6 @@ I<echo> accepts the following options:
8263
8364
Do not print a newline after the arguments.
8465
85-
=item -?
86-
87-
Print out a short help message, then exit.
88-
8966
=back
9067
9168
=head1 ENVIRONMENT

0 commit comments

Comments
 (0)