| 1 | #include <config.h>
|
|---|
| 2 | #include "search.h"
|
|---|
| 3 |
|
|---|
| 4 | static void
|
|---|
| 5 | Gcompile (char const *pattern, size_t size)
|
|---|
| 6 | {
|
|---|
| 7 | GEAcompile (pattern, size, RE_SYNTAX_GREP | RE_NO_EMPTY_RANGES);
|
|---|
| 8 | }
|
|---|
| 9 |
|
|---|
| 10 | static void
|
|---|
| 11 | Ecompile (char const *pattern, size_t size)
|
|---|
| 12 | {
|
|---|
| 13 | GEAcompile (pattern, size, RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES);
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 | static void
|
|---|
| 17 | Acompile (char const *pattern, size_t size)
|
|---|
| 18 | {
|
|---|
| 19 | GEAcompile (pattern, size, RE_SYNTAX_AWK);
|
|---|
| 20 | }
|
|---|
| 21 |
|
|---|
| 22 | struct matcher const matchers[] = {
|
|---|
| 23 | { "grep", Gcompile, EGexecute },
|
|---|
| 24 | { "egrep", Ecompile, EGexecute },
|
|---|
| 25 | { "awk", Acompile, EGexecute },
|
|---|
| 26 | { "fgrep", Fcompile, Fexecute },
|
|---|
| 27 | { "perl", Pcompile, Pexecute },
|
|---|
| 28 | { NULL, NULL, NULL },
|
|---|
| 29 | };
|
|---|
| 30 |
|
|---|
| 31 | const char before_options[] =
|
|---|
| 32 | N_("PATTERN is, by default, a basic regular expression (BRE).\n");
|
|---|
| 33 | const char after_options[] =
|
|---|
| 34 | N_("'egrep' means 'grep -E'. 'fgrep' means 'grep -F'.\n\
|
|---|
| 35 | Direct invocation as either 'egrep' or 'fgrep' is deprecated.\n");
|
|---|