]> git.draconx.ca Git - mpdhacks.git/commitdiff
Fix print_usage file handle in the perl scripts.
authorNick Bowler <nbowler@draconx.ca>
Sat, 23 May 2020 20:33:25 +0000 (16:33 -0400)
committerNick Bowler <nbowler@draconx.ca>
Sat, 23 May 2020 20:33:25 +0000 (16:33 -0400)
Due to an off-by-one error all the perl scripts are printing the usage
line to standard error in the --help output, instead of standard output
as expected.  Fix that up.

mpdexec.pl
mpdmenu.pl
mpdreload.pl

index 496c5581ff53b9f9f411f75d22fb8aaebb88f00d..4d25ead18d81c979860f4044aa7e1da4f429a01a 100755 (executable)
@@ -40,10 +40,10 @@ EOF
 }
 
 sub print_usage {
-       my $fh = $_[1] // *STDERR;
+       my ($fh) = (@_, *STDERR);
 
        print $fh "Usage: $0 [options] [command ...]\n";
-       print "Try $0 --help for more information.\n" unless (@_ > 0);
+       print $fh "Try $0 --help for more information.\n" unless (@_ > 0);
 }
 
 sub print_help {
index 526772a92e6c13fe41c2b4c3e2739d07d16f5634..3cc0e350d02e1d85f68377153163b41432de9145 100755 (executable)
@@ -453,10 +453,10 @@ EOF
 }
 
 sub print_usage {
-       my $fh = $_[1] // *STDERR;
+       my ($fh) = (@_, *STDERR);
 
        print $fh "Usage: $0 [options]\n";
-       print "Try $0 --help for more information.\n" unless (@_ > 0);
+       print $fh "Try $0 --help for more information.\n" unless (@_ > 0);
 }
 
 sub print_help {
index 6305783947fe63e1fe33499e119647c50c8b0fee..c852a2bd4b85e693ab9eb396d0451816d7193a85 100755 (executable)
@@ -90,10 +90,10 @@ EOF
 }
 
 sub print_usage {
-       my $fh = $_[1] // *STDERR;
+       my ($fh) = (@_, *STDERR);
 
        print $fh "Usage: $0 [options] playlist\n";
-       print "Try $0 --help for more information.\n" unless (@_ > 0);
+       print $fh "Try $0 --help for more information.\n" unless (@_ > 0);
 }
 
 sub print_help {