summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorLibravatar Nguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-05-26 15:55:24 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-05-29 14:51:28 +0900
commit3ac68a93fd2b984e2a7e570217d2646a208ffcc3 (patch)
treea2daa2ec0763d187815899c677681ff7ccb6acf8 /diff.c
parentfsck: factor out msg_id_info[] lazy initialization code (diff)
downloadtgif-3ac68a93fd2b984e2a7e570217d2646a208ffcc3.tar.xz
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 'diff.c')
-rw-r--r--diff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index 56d7bfded6..513410d46b 100644
--- a/diff.c
+++ b/diff.c
@@ -22,6 +22,7 @@
#include "argv-array.h"
#include "graph.h"
#include "packfile.h"
+#include "help.h"
#ifdef NO_FAST_WORKING_DIRECTORY
#define FAST_WORKING_DIRECTORY 0
@@ -93,6 +94,8 @@ static NORETURN void die_want_option(const char *option_name)
die(_("option '%s' requires a value"), option_name);
}
+define_list_config_array_extra(color_diff_slots, {"plain"});
+
static int parse_diff_color_slot(const char *var)
{
if (!strcasecmp(var, "plain"))