App-Gre

 view release on metacpan or  search on metacpan

lib/App/Gre.pm  view on Meta::CPAN

Then you wouldn't have a chance to disable it:

    $ gre -line1='^#!/bin/bash' -noxname='~$' -xname='~$'

It would still filter out the backup files.

The result should be intuitive. For example, if you want to
search everything except one file that's messing up the search add:

    $ gre -xname=INBOX.mbox -ext=mbox qwerty

and you wouldn't have to worry about order of these filters.

If you want to remove all the builtin "exclude" filters, use -x on
the command line. By default, gre will exclude backup files, swap
files, core dumps, .git directories, .svn directories, binary files,
minimized js files, and more. See the output of -c for the full
list.

"exclude" filters also have another property which the regular
"include" filters don't have: They prune the recursive file search.
So -xnamee=.git will prevent any file under a .git directory from
being searched (the extra e at the end of -xname means to use
string equality not regexp's for the match). Normal "include"
filters do not execute on directories.

You can control the depth of the recursion with the -d option.  -d0
is for unlimited recursion (the default), -d1 disables recursion,
-d2 will only let recursion go two levels deep.

Files listed on the command line are always searched regardless of
the filters.

Symlinks are not followed. This is usually what you want and otherwise
you might end up in an infinite loop.

You can do multiline regexp's '^sub.*^\}' (with the addition of the
-m option)

The script doesn't bundle options so it only uses one dash for the
long options.

Options that take arguments can be given like -ext=foo or -ext foo.

Option names for file filters can include:

=over

=item * "no" filters files out,

=item * "i" makes the regexp case insensitive,

=item * "e" makes the match use string equality instead of regexp,

=item * "r" makes the match use regexp instead of string equality,

=item * "x" makes it an excluding filter

=back

=head1 OUTPUT STYLES

You can specify the output style with the -y option:

-y1 groups output by filename, with each matching line prepended
with it's line number. This is the default.

-y2 looks like classic grep output. Each line looks like file:line:match.

-y3 just has the matching line. This is the default for piped input.
goes well with the -p option sometimes.

-k will disable color output.

-o will show only the match (as opposed to the entire matching line).

-p=<str> can be used to display the output in your own way. For
example,

    $ gre '(foo)(bar)' -p='<<$2-$1>>'

-A -B -C -AE<lt>nE<gt> -BE<lt>nE<gt> -CE<lt>nE<gt> will show some
lines of context around the match. -B for before, -A after, -C both.
All of these can take an optional number parameter. If missing it
will be 2.

=head1 RC FILE

You can place default options into ~/.grerc file. the format is a
list of whitespace separated options that will be applied to every
call to gre right after the built-in filters but before command
line filters. For example:

    -xpath=template_compiles
    -xpath=templates/cache
    -xnamee=yui

=head1 INSTALLATION

gre is a single script with no dependencies. Copy it to a place in your
$PATH and it should work as-is. The App::Gre module is just an unused
placeholder module to make it work with CPAN.

You can also run "cpan App::Gre" to install it.

=head1 SEE ALSO

grep(1) L<http://www.gnu.org/savannah-checkouts/gnu/grep/manual/grep.html>

ack(1) L<http://beyondgrep.com/>

=head1 METACPAN

L<https://metacpan.org/pod/App::Gre>

=head1 REPOSITORY

L<https://github.com/zorgnax/gre>

=head1 AUTHOR



( run in 0.935 second using v1.01-cache-2.11-cpan-39bf76dae61 )