]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
xzgrep: Avoid passing both -q and -l to grep.
authorLasse Collin <lasse.collin@tukaani.org>
Thu, 9 Oct 2014 15:42:14 +0000 (18:42 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Wed, 17 Dec 2014 19:13:42 +0000 (21:13 +0200)
The behavior of grep -ql varies:
  - GNU grep behaves like grep -q.
  - OpenBSD grep behaves like grep -l.

POSIX doesn't make it 100 % clear what behavior is expected.
Anyway, using both -q and -l at the same time makes no sense
so both options simply should never be used at the same time.

Thanks to Christian Weisgerber.

src/scripts/xzgrep.in

index b927a5590b9e1d994eeaa5bde675604deb388ca8..3ecb7cf08b07f8913e6c9094c3eec9422dcb8951 100644 (file)
@@ -106,9 +106,11 @@ while test $# -ne 0; do
     with_filename=1
     continue;;
   (-l | --files-with-*)
-    files_with_matches=1;;
+    files_with_matches=1
+    continue;;
   (-L | --files-witho*)
-    files_without_matches=1;;
+    files_without_matches=1
+    continue;;
   (-h | --no-f*)
     no_filename=1;;
   (-V | --v | --ve | --ver | --vers | --versi | --versio | --version)