1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00

xzgrep: Avoid passing both -q and -l to grep.

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.
This commit is contained in:
Lasse Collin 2014-10-09 18:42:14 +03:00
parent 9c5f76098c
commit efa7b0a210

View file

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