From 87725010882774876b8497204659d502213aa3e3 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 24 Jun 2013 15:18:31 -0400 Subject: usage information should go to stderr on error --- lib/Reply/App.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/Reply/App.pm b/lib/Reply/App.pm index beddf84..d8bd52c 100644 --- a/lib/Reply/App.pm +++ b/lib/Reply/App.pm @@ -80,24 +80,28 @@ sub run { return 0; } -=method usage +=method usage($exitcode) -Prints usage information to the screen. +Prints usage information to the screen. If C<$exitcode> is 0, it will be +printed to C, otherwise it will be printed to C. =cut sub usage { - print " reply [--version] [--help] [--cfg file]\n"; + my $fh = $_[0] ? *STDERR : *STDOUT; + print $fh " reply [--version] [--help] [--cfg file]\n"; } -=method version +=method version($exitcode) -Prints version information to the screen. +Prints version information to the screen. If C<$exitcode> is 0, it will be +printed to C, otherwise it will be printed to C. =cut sub version { - print "Reply version $Reply::VERSION\n"; + my $fh = $_[0] ? *STDERR : *STDOUT; + print $fh "Reply version $Reply::VERSION\n"; } 1; -- cgit v1.2.3-54-g00ecf