Fix zgrep --version

"zgrep --version" is expected to print the version information in the
same way as "zgrep -V". However, the case handling the --version flag
is never reached, so "zgrep --version" prints:
    zgrep: missing pattern
instead of:
    grep (BSD grep, GNU compatible) 2.6.0-FreeBSD

Reviewed by:	yuripv
Approved by:	yuripv (src)
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D29813
This commit is contained in:
Mateusz Piotrowski 2021-04-13 12:12:53 +02:00
parent 1ffdcdadf6
commit 16e0391f8e

View File

@ -94,6 +94,9 @@ do
silent=1 silent=1
shift shift
;; ;;
-V|--version)
exec ${grep} -V
;;
--*) --*)
grep_args="${grep_args} $1" grep_args="${grep_args} $1"
shift shift
@ -128,9 +131,6 @@ do
echo "${prg}: the ${1} flag is not currently supported" >&2 echo "${prg}: the ${1} flag is not currently supported" >&2
exit 1 exit 1
;; ;;
-V|--version)
exec ${grep} -V
;;
-*) -*)
grep_args="${grep_args} $1" grep_args="${grep_args} $1"
shift shift