File tree 1 file changed +3
-26
lines changed
1 file changed +3
-26
lines changed Original file line number Diff line number Diff line change @@ -15,33 +15,15 @@ package PerlPowerTools::echo;
15
15
16
16
use strict;
17
17
18
- my ($VERSION ) = ' 1.2 ' ;
18
+ my ($VERSION ) = ' 1.3 ' ;
19
19
20
20
__PACKAGE__ -> run( @ARGV ) unless caller ();
21
21
22
22
sub run {
23
23
my ( $self , @args ) = @_ ;
24
24
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
-
43
25
my $N = 1;
44
- if ($args [0] eq ' -n' ) {
26
+ if (@args && $args [0] eq ' -n' ) {
45
27
$N = 0;
46
28
shift @args ;
47
29
}
50
32
print " \n " if $N == 1;
51
33
52
34
exit 0;
53
-
54
35
}
55
36
56
37
1;
@@ -69,7 +50,7 @@ echo [-n] [arguments...]
69
50
70
51
=head1 DESCRIPTION
71
52
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
73
54
printed at the end unless the '-n' option is given.
74
55
75
56
=head2 OPTIONS
@@ -82,10 +63,6 @@ I<echo> accepts the following options:
82
63
83
64
Do not print a newline after the arguments.
84
65
85
- =item -?
86
-
87
- Print out a short help message, then exit.
88
-
89
66
=back
90
67
91
68
=head1 ENVIRONMENT
You can’t perform that action at this time.
0 commit comments