wrapper scripts: write diagnostics to stderr, not to stdout
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 1 Feb 2010 21:40:41 +0000 (00:40 +0300)
committerJim Meyering <meyering@redhat.com>
Wed, 3 Feb 2010 05:29:42 +0000 (06:29 +0100)
* zforce.in: In case of usage error, output short error diagnostics to
stderr instead of printing help text to stdout.
* zmore.in: Likewise.
* znew.in: Likewise.

zforce.in
zmore.in
znew.in

index b9e057d6fced3bb0e6b269cec288d17cbf29af09..fdce8b6c239881a2141ee88859e030d3a67a2364 100644 (file)
--- a/zforce.in
+++ b/zforce.in
@@ -44,7 +44,7 @@ not compress them twice.
 Report bugs to <bug-gzip@gnu.org>."
 
 if test $# = 0; then
-  echo "$usage"
+  echo >&2 "$0: invalid number of operands; try \`$0 --help' for help"
   exit 1
 fi
 
index 64b144d840a540a0ff0f77865f13a378680f5e71..0f048c9144a4d49c4d03a835f807b54db0892d8c 100644 (file)
--- a/zmore.in
+++ b/zmore.in
@@ -57,7 +57,7 @@ fi
 
 if test $# = 0; then
     if test -t 0; then
-       echo "$usage"
+       echo >&2 "$0: invalid number of operands; try \`$0 --help' for help"
     else
        gzip -cdfq | eval ${PAGER-more}
     fi
diff --git a/znew.in b/znew.in
index 43f3148a2beee1a57ae40a0a25f6dca9bbabdc39..78ae253afaa3171b2a2058a9df81ebf28e7c25db 100644 (file)
--- a/znew.in
+++ b/znew.in
@@ -97,7 +97,7 @@ do
 done
 
 if test $# -eq 0; then
-  echo "$usage"
+  echo >&2 "$0: invalid number of operands; try \`$0 --help' for help"
   exit 1
 fi