zgrep: fix parsing of -Eh options
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 15 Sep 2010 17:55:19 +0000 (10:55 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 15 Sep 2010 17:55:44 +0000 (10:55 -0700)
* zgrep.in: Update list of single-letter options to match what's
in GNU grep.  Add -h as an alias for --no-filename.  Bug reported
by Vladimir Sidorenko in
<http://lists.gnu.org/archive/html/bug-gzip/2010-09/msg00007.html>.

zgrep.in

index 5d9e6d10f7f1a193cc22a5305407049ab6c12d49..6dec3a9e779721bbf4dc06c242079d4b45f061a8 100644 (file)
--- a/zgrep.in
+++ b/zgrep.in
@@ -64,13 +64,13 @@ while test $# -ne 0; do
   optarg=
 
   case $option in
-  (-[0123456789abcdhHiIKLlnoqrRsTuUvVwxyzZ]?*)
+  (-[0123456789EFGHIKLPRTUVZabchilnoqrsuvwxyz]?*)
     arg2=-\'$(expr "X${option}X" : 'X-.[0-9]*\(.*\)' | sed "$escape")
     eval "set -- $arg2 "'${1+"$@"}'
     option=$(expr "X$option" : 'X\(-.[0-9]*\)');;
   (--binary-*=* | --[lm]a*=* | --reg*=*)
     ;;
-  (-[ABCDefm] | --binary-* | --file | --[lm]a* | --reg*)
+  (-[ABCDXdefm] | binary-* | --file | --[lm]a* | --reg*)
     case ${1?"$option option requires an argument"} in
     (*\'*)
       optarg=" '"$(printf '%sX\n' "$1" | sed "$escape");;
@@ -138,7 +138,7 @@ while test $# -ne 0; do
     files_with_matches=1;;
   (-L | --files-witho*)
     files_without_matches=1;;
-  (--no-f*)
+  (-h | --no-f*)
     no_filename=1;;
   (-V | --v | --ve | --ver | --vers | --versi | --versio | --version)
     echo "$version" || exit 2