summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ec014ea)
raw | patch | inline | side by side (parent: ec014ea)
author | Jon Seymour <jon.seymour@gmail.com> | |
Sun, 1 May 2011 08:16:25 +0000 (18:16 +1000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 2 May 2011 04:50:04 +0000 (21:50 -0700) |
Similar to the way the --html-path option lets UI programs learn where git
has its HTML documentation pages, expose the other two paths used to store
the documentation pages of these two types.
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
has its HTML documentation pages, expose the other two paths used to store
the documentation pages of these two types.
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git.txt | patch | blob | history | |
Makefile | patch | blob | history | |
git.c | patch | blob | history |
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 9d5949229abac83b3e38b4f08565653f10492360..7e9b521cd9c139c15cc441122981a3e875a8e174 100644 (file)
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
SYNOPSIS
--------
[verse]
-'git' [--version] [--exec-path[=<path>]] [--html-path]
+'git' [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects]
[--bare] [--git-dir=<path>] [--work-tree=<path>]
[-c <name>=<value>]
Print the path to wherever your git HTML documentation is installed
and exit.
+--man-path::
+ Print the path to wherever your git man pages are installed
+ and exit.
+
+--info-path::
+ Print the path to wherever your git Info files are installed
+ and exit.
+
-p::
--paginate::
Pipe all output into 'less' (or if set, $PAGER) if standard
diff --git a/Makefile b/Makefile
index cbc3fce2d573ac313ee1b8f19749432cff3b31b5..322c59b7618f449be361b9d8e77cea99f8405995 100644 (file)
--- a/Makefile
+++ b/Makefile
git.o: common-cmds.h
git.s git.o: EXTRA_CPPFLAGS = -DGIT_VERSION='"$(GIT_VERSION)"' \
- '-DGIT_HTML_PATH="$(htmldir_SQ)"'
+ '-DGIT_HTML_PATH="$(htmldir_SQ)"' \
+ '-DGIT_MAN_PATH="$(mandir_SQ)"' \
+ '-DGIT_INFO_PATH="$(infodir_SQ)"'
git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \
index ef598c3e7053b8dd2859f4d582ce2917a804fe42..60a9403771879da0e39a456055e22844905aac68 100644 (file)
--- a/git.c
+++ b/git.c
#include "run-command.h"
const char git_usage_string[] =
- "git [--version] [--exec-path[=<path>]] [--html-path]\n"
+ "git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p|--paginate|--no-pager] [--no-replace-objects]\n"
" [--bare] [--git-dir=<path>] [--work-tree=<path>]\n"
" [-c name=value] [--help]\n"
} else if (!strcmp(cmd, "--html-path")) {
puts(system_path(GIT_HTML_PATH));
exit(0);
+ } else if (!strcmp(cmd, "--man-path")) {
+ puts(system_path(GIT_MAN_PATH));
+ exit(0);
+ } else if (!strcmp(cmd, "--info-path")) {
+ puts(system_path(GIT_INFO_PATH));
+ exit(0);
} else if (!strcmp(cmd, "-p") || !strcmp(cmd, "--paginate")) {
use_pager = 1;
} else if (!strcmp(cmd, "--no-pager")) {