diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2018-05-26 15:55:24 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-29 14:51:28 +0900 |
commit | 3ac68a93fd2b984e2a7e570217d2646a208ffcc3 (patch) | |
tree | a2daa2ec0763d187815899c677681ff7ccb6acf8 /grep.c | |
parent | a46baac61ebc6a8b187f76bcd49b625e0d4f408e (diff) | |
download | git-3ac68a93fd2b984e2a7e570217d2646a208ffcc3.tar.gz |
help: add --config to list all available config
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 <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'grep.c')
-rw-r--r-- | grep.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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. |