From ba8ea7496f2b95c49fccb72ed6b332afbd865e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Mon, 1 Aug 2011 19:20:53 +0200 Subject: grep: add option to show whole function as context Add a new option, -W, to show the whole surrounding function of a match. It uses the same regular expressions as -p and diff to find the beginning of sections. Currently it will not display comments in front of a function, but those that are following one. Despite this shortcoming it is already useful, e.g. to simply see a more complete applicable context or to extract whole functions. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- grep.h | 1 + 1 file changed, 1 insertion(+) (limited to 'grep.h') diff --git a/grep.h b/grep.h index c5682973e..ae50c45a4 100644 --- a/grep.h +++ b/grep.h @@ -98,6 +98,7 @@ struct grep_opt { int color; int max_depth; int funcname; + int funcbody; char color_context[COLOR_MAXLEN]; char color_filename[COLOR_MAXLEN]; char color_function[COLOR_MAXLEN]; -- cgit v1.2.1