From 84befcd0a4a074e2ae191c32be09d2e82d5db114 Mon Sep 17 00:00:00 2001 From: J Smith Date: Fri, 3 Aug 2012 10:53:50 -0400 Subject: grep: add a grep.patternType configuration setting The grep.extendedRegexp configuration setting enables the -E flag on grep by default but there are no equivalents for the -G, -F and -P flags. Rather than adding an additional setting for grep.fooRegexp for current and future pattern matching options, add a grep.patternType setting that can accept appropriate values for modifying the default grep pattern matching behavior. The current values are "basic", "extended", "fixed", "perl" and "default" for setting -G, -E, -F, -P and the default behavior respectively. When grep.patternType is set to a value other than "default", the grep.extendedRegexp setting is ignored. The value of "default" restores the current default behavior, including the grep.extendedRegexp behavior. Signed-off-by: J Smith Signed-off-by: Junio C Hamano --- grep.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'grep.h') diff --git a/grep.h b/grep.h index ed7de6bec..75afb7b10 100644 --- a/grep.h +++ b/grep.h @@ -58,6 +58,14 @@ enum grep_expr_node { GREP_NODE_OR }; +enum grep_pattern_type { + GREP_PATTERN_TYPE_UNSPECIFIED = 0, + GREP_PATTERN_TYPE_BRE, + GREP_PATTERN_TYPE_ERE, + GREP_PATTERN_TYPE_FIXED, + GREP_PATTERN_TYPE_PCRE +}; + struct grep_expr { enum grep_expr_node node; unsigned hit; @@ -103,6 +111,8 @@ struct grep_opt { int max_depth; int funcname; int funcbody; + int extended_regexp_option; + int pattern_type_option; char color_context[COLOR_MAXLEN]; char color_filename[COLOR_MAXLEN]; char color_function[COLOR_MAXLEN]; -- cgit v1.2.1