From 3ac68a93fd2b984e2a7e570217d2646a208ffcc3 Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Sat, 26 May 2018 15:55:24 +0200 Subject: help: add --config to list all available config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sometimes it helps to list all available config vars so the user can search for something they want. The config man page can also be used but it's harder to search if you want to focus on the variable name, for example. This is not the best way to collect the available config since it's not precise. Ideally we should have a centralized list of config in C code (pretty much like 'struct option'), but that's a lot more work. This will do for now. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- grep.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'grep.c') diff --git a/grep.c b/grep.c index b7012f40f5..bf71b130c2 100644 --- a/grep.c +++ b/grep.c @@ -7,6 +7,7 @@ #include "diffcore.h" #include "commit.h" #include "quote.h" +#include "help.h" static int grep_source_load(struct grep_source *gs); static int grep_source_is_binary(struct grep_source *gs); @@ -80,6 +81,8 @@ static int parse_pattern_type_arg(const char *opt, const char *arg) die("bad %s argument: %s", opt, arg); } +define_list_config_array_extra(color_grep_slots, {"match"}); + /* * Read the configuration file once and store it in * the grep_defaults template. -- cgit v1.3