summaryrefslogtreecommitdiff
path: root/builtin/help.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2012-04-13 17:54:37 +0700
committerJunio C Hamano <gitster@pobox.com>2012-04-27 09:26:38 -0700
commitdbfae689690bead0e49130b149c869834795cf81 (patch)
tree37b6a96c95d601425b761ac51cdf7157592be31e /builtin/help.c
parent3f8eccbe166ecff79a986b7ce87df4963cc873b2 (diff)
downloadgit-dbfae689690bead0e49130b149c869834795cf81.tar.gz
help: reuse print_columns() for help -a
"help -a" also respects column.ui (and column.help if presents) 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 'builtin/help.c')
-rw-r--r--builtin/help.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/builtin/help.c b/builtin/help.c
index 61ff79839b..c64f1522d8 100644
--- a/builtin/help.c
+++ b/builtin/help.c
@@ -9,6 +9,7 @@
#include "common-cmds.h"
#include "parse-options.h"
#include "run-command.h"
+#include "column.h"
#include "help.h"
static struct man_viewer_list {
@@ -30,6 +31,7 @@ enum help_format {
};
static int show_all = 0;
+static unsigned int colopts;
static enum help_format help_format = HELP_FORMAT_NONE;
static struct option builtin_help_options[] = {
OPT_BOOLEAN('a', "all", &show_all, "print all available commands"),
@@ -251,6 +253,8 @@ static int add_man_viewer_info(const char *var, const char *value)
static int git_help_config(const char *var, const char *value, void *cb)
{
+ if (!prefixcmp(var, "column."))
+ return git_column_config(var, value, "help", &colopts);
if (!strcmp(var, "help.format")) {
if (!value)
return config_error_nonbool(var);
@@ -424,8 +428,9 @@ int cmd_help(int argc, const char **argv, const char *prefix)
parsed_help_format = help_format;
if (show_all) {
+ git_config(git_help_config, NULL);
printf("usage: %s\n\n", git_usage_string);
- list_commands("git commands", &main_cmds, &other_cmds);
+ list_commands("git commands", colopts, &main_cmds, &other_cmds);
printf("%s\n", git_more_info_string);
return 0;
}