Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 447006

Summary: app-portage/portage-utils: qgrep: should parse multiple args over entire file for broader search results
Product: Portage Development Reporter: Pariksheet Nanda <pariksheet.nanda>
Component: Third-Party ToolsAssignee: Fabian Groffen <grobian>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Pariksheet Nanda 2012-12-12 14:12:20 UTC
qgrep should default to searching multiple arguments anywhere in a file.

Reproducible: Always

Steps to Reproduce:
Run `grep cmake-utils swig`
Actual Results:  
No result is found

Expected Results:  
qgrep should search for both search terms in the file such as:
grep -rl 'cmake-utils' --include '*.ebuild' /usr/portage | xargs grep -l 'swig'
Comment 1 Fabian Groffen gentoo-dev 2018-03-31 18:42:39 UTC
Ok, I see what you want, but grep doesn't support this behaviour either.  Instead, it allows you to use alternatives in your regex argument, e.g. grep -E '(a|b)'.  Since qgrep supports regexes, you can just do the same.

In your scenario:

qgrep -x '(cmake-utils|swig)'