diff options
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | 2009-03-07 13:32:32 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-03-07 11:34:59 -0800 |
commit | 7e8f59d577e5615ceff06da0d9dde36a63608d53 (patch) | |
tree | 3c9caf532b29a9780ce4065a302c87d9c5f320ef /grep.h | |
parent | 79212772ce127cc32a67d50eaaa7f1c102ce7d5d (diff) | |
download | git-7e8f59d577e5615ceff06da0d9dde36a63608d53.tar.gz |
grep: color patterns in output
Coloring matches makes them easier to spot in the output.
Add two options and two parameters: color.grep (to turn coloring on
or off), color.grep.match (to set the color of matches), --color
and --no-color (to turn coloring on or off, respectively).
The output of external greps is not changed.
This patch is based on earlier ones by Nguyễn Thái Ngọc Duy and
Thiago Alves.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'grep.h')
-rw-r--r-- | grep.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1,5 +1,6 @@ #ifndef GREP_H #define GREP_H +#include "color.h" enum grep_pat_token { GREP_PATTERN, @@ -77,6 +78,8 @@ struct grep_opt { unsigned relative:1; unsigned pathname:1; unsigned null_following_name:1; + int color; + char color_match[COLOR_MAXLEN]; int regflags; unsigned pre_context; unsigned post_context; |