summaryrefslogtreecommitdiff
path: root/builtin/help.c
diff options
context:
space:
mode:
authorVincent van Ravesteijn <vfr@lyx.org>2012-06-06 20:28:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-06-06 21:14:13 (GMT)
commit1cc8af044cad37b5f7df85b177f6aa979aa3215a (patch)
tree4298baf6dde05d6f441c1ffb847d486f9fbdf272 /builtin/help.c
parentbefc5ed3799cb6fcbaa7de03e7fa1760e846853c (diff)
downloadgit-1cc8af044cad37b5f7df85b177f6aa979aa3215a.zip
git-1cc8af044cad37b5f7df85b177f6aa979aa3215a.tar.gz
git-1cc8af044cad37b5f7df85b177f6aa979aa3215a.tar.bz2
help: use HTML as the default help format on Windows
When 'git help $cmd' is run without a format option (e.g. -w), the 'man' format is always used. On some platforms, however, manual page viewers are not often available. Introduce DEFAULT_HELP_FORMAT make variable in order to allow the default format configurable at compile time, and set it to HTML when compiling on Windows (but not Cygwin). Helped-by: Jeff King <peff@peff.net> Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/help.c')
-rw-r--r--builtin/help.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin/help.c b/builtin/help.c
index 43d3c84..536d4fd 100644
--- a/builtin/help.c
+++ b/builtin/help.c
@@ -12,6 +12,10 @@
#include "column.h"
#include "help.h"
+#ifndef DEFAULT_HELP_FORMAT
+#define DEFAULT_HELP_FORMAT "man"
+#endif
+
static struct man_viewer_list {
struct man_viewer_list *next;
char name[FLEX_ARRAY];
@@ -445,7 +449,9 @@ int cmd_help(int argc, const char **argv, const char *prefix)
setup_git_directory_gently(&nongit);
git_config(git_help_config, NULL);
- if (parsed_help_format != HELP_FORMAT_NONE)
+ if (parsed_help_format == HELP_FORMAT_NONE)
+ help_format = parse_help_format(DEFAULT_HELP_FORMAT);
+ else
help_format = parsed_help_format;
alias = alias_lookup(argv[0]);