From 8a39a0fd4ed8d545759e07937fa4c66f5d324987 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Sat, 23 May 2020 16:33:25 -0400 Subject: [PATCH] Fix print_usage file handle in the perl scripts. 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 | 4 ++-- mpdmenu.pl | 4 ++-- mpdreload.pl | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mpdexec.pl b/mpdexec.pl index 496c558..4d25ead 100755 --- a/mpdexec.pl +++ b/mpdexec.pl @@ -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 { diff --git a/mpdmenu.pl b/mpdmenu.pl index 526772a..3cc0e35 100755 --- a/mpdmenu.pl +++ b/mpdmenu.pl @@ -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 { diff --git a/mpdreload.pl b/mpdreload.pl index 6305783..c852a2b 100755 --- a/mpdreload.pl +++ b/mpdreload.pl @@ -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 { -- 2.43.2