git: add --info-path and --man-path options
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>
Jon Seymour committed
May 1, 2011 at 18:16 UTC
f2dd8c3799ddbd7df63a89a9043916f8545a70a3
3 files changed
+19
-3
Documentation/git.txt
+9
-1
@@ -9,7 +9,7 @@ git - the stupid content tracker
9
SYNOPSIS
10
--------
11
[verse]
12
-'git' [--version] [--exec-path[=<path>]] [--html-path]
12
+'git' [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
13
[-p|--paginate|--no-pager] [--no-replace-objects]
14
[--bare] [--git-dir=<path>] [--work-tree=<path>]
15
[-c <name>=<value>]
@@ -290,6 +290,14 @@ help ...`.
290
Print the path to wherever your git HTML documentation is installed
291
and exit.
292
293
+--man-path::
294
+ Print the path to wherever your git man pages are installed
295
+ and exit.
296
+
297
+--info-path::
298
+ Print the path to wherever your git Info files are installed
299
+ and exit.
300
+
301
-p::
302
--paginate::
303
Pipe all output into 'less' (or if set, $PAGER) if standard
Makefile
+3
-1
@@ -1676,7 +1676,9 @@ strip: $(PROGRAMS) git$X
1676
1677
git.o: common-cmds.h
1678
git.s git.o: EXTRA_CPPFLAGS = -DGIT_VERSION='"$(GIT_VERSION)"' \
1679
- '-DGIT_HTML_PATH="$(htmldir_SQ)"'
1679
+ '-DGIT_HTML_PATH="$(htmldir_SQ)"' \
1680
+ '-DGIT_MAN_PATH="$(mandir_SQ)"' \
1681
+ '-DGIT_INFO_PATH="$(infodir_SQ)"'
1682
1683
git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)
1684
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \
git.c
+7
-1
@@ -6,7 +6,7 @@
6
#include "run-command.h"
7
8
const char git_usage_string[] =
9
- "git [--version] [--exec-path[=<path>]] [--html-path]\n"
9
+ "git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
10
" [-p|--paginate|--no-pager] [--no-replace-objects]\n"
11
" [--bare] [--git-dir=<path>] [--work-tree=<path>]\n"
12
" [-c name=value] [--help]\n"
@@ -95,6 +95,12 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
95
} else if (!strcmp(cmd, "--html-path")) {
96
puts(system_path(GIT_HTML_PATH));
97
exit(0);
98
+ } else if (!strcmp(cmd, "--man-path")) {
99
+ puts(system_path(GIT_MAN_PATH));
100
+ exit(0);
101
+ } else if (!strcmp(cmd, "--info-path")) {
102
+ puts(system_path(GIT_INFO_PATH));
103
+ exit(0);
104
} else if (!strcmp(cmd, "-p") || !strcmp(cmd, "--paginate")) {
105
use_pager = 1;
106
} else if (!strcmp(cmd, "--no-pager")) {