App-BoolFindGrep

 view release on metacpan or  search on metacpan

bin/bfg  view on Meta::CPAN

=head1 NAME

bfg - find and grep files using boolean expressions.

=head1 VERSION

version 0.06

=head1 DESCRIPTION

This program combines the power of three Unix tools (in their GNU versions): bool, find and grep to provide a way to search by filenames and/or by file contents using boolean expressions. Internaly, all boolean expressions with regexps/strings are tr...

Complex searches using B<grep> are very painful and B<bool> have lots of limitations and complex escape rules. B<bfg> simplify these searches by using more clear syntax and better performance in some cases.

For example, to search

    first AND second AND third AND fourth AND NOT fifth

in filenames, and the same expression in file contents using B<find> and B<grep>, you need do:

    find . \

t/app-boolfindgrep-bool.t  view on Meta::CPAN

        = $EVAL_ERROR
        ? [ ( split m{:}msx, $EVAL_ERROR )[0] ]
        : $obj->parse();
    is_deeply( $output, $expected, $testname );
}

done_testing();

# Local Variables:
# mode: perl
# coding: utf-8-unix
# End:

t/app-boolfindgrep-grep.t  view on Meta::CPAN

    foreach my $key ( keys %output ) {
        $output = $output{$key};
    }
    is_deeply( $output, $expected, $testname );
}

done_testing();

# Local Variables:
# mode: perl
# coding: utf-8-unix
# End:

t/app-boolfindgrep.t  view on Meta::CPAN

        my $test_name = qq(find_type=>'$find_type', file_expr=>'$file_expr');
        cmp_ok( $sum_files, q(==), $found_files, $test_name ) or die;
    }
} ## end foreach my $test (@test)

remove_tree $tmpdir;
done_testing();

# Local Variables:
# mode: perl
# coding: utf-8-unix
# End:

xt/author/eol.t  view on Meta::CPAN

    'lib/App/BoolFindGrep/Bool.pm',
    'lib/App/BoolFindGrep/CLI.pm',
    'lib/App/BoolFindGrep/Find.pm',
    'lib/App/BoolFindGrep/Grep.pm',
    't/00-compile.t',
    't/app-boolfindgrep-bool.t',
    't/app-boolfindgrep-grep.t',
    't/app-boolfindgrep.t'
);

eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files;
done_testing;



( run in 2.093 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )