Subject: Re: bug#27783: display help instead of pattern search
From: Eric Blake <[email-masked]>
To: PAYET Matthieu -EXT <[email-masked]>, [email-masked]
Date: Fri, 21 Jul 2017 10:07:58 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

tag 27783 notabug
thanks

On 07/21/2017 02:46 AM, PAYET Matthieu -EXT wrote:
> Hello,
> 
> Grep v2.6.3
> 
>> grep -ri "--help" .
> 
> Displays the help message instead of searching for the requested pattern.

Because you didn't tell grep the options were over.  You want:

grep -ri -- --help

> Same behavior for the pattern "--version"

Ditto for any other pattern with a leading '-' - use -- to tell grep
that you are done with option parsing and to treat the next argument as
a pattern or filename.

> CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged.

Sorry, but your disclaimer is unenforceable on publicly-archived lists.
Please consider using a personal address to avoid spamming us with your
employer's legalese.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org