summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2011-08-01 17:22:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-08-01 23:11:50 (GMT)
commit317f63c21c8eac46813eacf487485445f2f79a6d (patch)
tree2a96218e0b83f25efaea60685dc89dca0e4687b5 /builtin
parentba8ea7496f2b95c49fccb72ed6b332afbd865e7b (diff)
downloadgit-317f63c21c8eac46813eacf487485445f2f79a6d.zip
git-317f63c21c8eac46813eacf487485445f2f79a6d.tar.gz
git-317f63c21c8eac46813eacf487485445f2f79a6d.tar.bz2
grep: long context options
Take long option names for -A (--after-context), -B (--before-context) and -C (--context) from GNU grep and add a similar long option name for -W (--function-context). Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/grep.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index 1fae662..1851797 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -827,18 +827,18 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
OPT_BOOLEAN(0, "heading", &opt.heading,
"show filename only once above matches from same file"),
OPT_GROUP(""),
- OPT_CALLBACK('C', NULL, &opt, "n",
+ OPT_CALLBACK('C', "context", &opt, "n",
"show <n> context lines before and after matches",
context_callback),
- OPT_INTEGER('B', NULL, &opt.pre_context,
+ OPT_INTEGER('B', "before-context", &opt.pre_context,
"show <n> context lines before matches"),
- OPT_INTEGER('A', NULL, &opt.post_context,
+ OPT_INTEGER('A', "after-context", &opt.post_context,
"show <n> context lines after matches"),
OPT_NUMBER_CALLBACK(&opt, "shortcut for -C NUM",
context_callback),
OPT_BOOLEAN('p', "show-function", &opt.funcname,
"show a line with the function name before matches"),
- OPT_BOOLEAN('W', NULL, &opt.funcbody,
+ OPT_BOOLEAN('W', "function-context", &opt.funcbody,
"show the surrounding function"),
OPT_GROUP(""),
OPT_CALLBACK('f', NULL, &opt, "file",