From: Jon Seymour <jon.seymour@gmail.com>
To: git@vger.kernel.org
Cc: jrnieder@gmail.com, gitster@pobox.com,
Jon Seymour <jon.seymour@gmail.com>
Subject: [PATCH] Add --info-path and --man-path options to git.
Date: Sun, 1 May 2011 18:16:25 +1000 [thread overview]
Message-ID: <1304237785-56101-1-git-send-email-jon.seymour@gmail.com> (raw)
To better support git extensions provided by 3rd parties
which would like to install their own man pages and Info files
in the same place as git's own man pages and Info files
add support for --man-path and --info-path options.
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
---
Documentation/git.txt | 10 +++++++++-
Makefile | 4 +++-
git.c | 8 +++++++-
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/Documentation/git.txt b/Documentation/git.txt
index e4d43a9..c495322 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -9,7 +9,7 @@ git - the stupid content tracker
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>]
@@ -285,6 +285,14 @@ help ...`.
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 f5308fe..9119aaa 100644
--- a/Makefile
+++ b/Makefile
@@ -1684,7 +1684,9 @@ strip: $(PROGRAMS) git$X
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 \
diff --git a/git.c b/git.c
index ef598c3..60a9403 100644
--- a/git.c
+++ b/git.c
@@ -6,7 +6,7 @@
#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"
@@ -95,6 +95,12 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
} 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")) {
--
1.7.5.rc3.46.g7f712.dirty
next reply other threads:[~2011-05-01 8:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-01 8:16 Jon Seymour [this message]
2011-05-01 18:15 ` [PATCH] Add --info-path and --man-path options to git Junio C Hamano
2011-05-01 22:47 ` Jon Seymour
2011-05-01 23:48 ` Jonathan Nieder
2011-05-01 23:53 ` Jonathan Nieder
2011-05-02 0:02 ` Junio C Hamano
2011-05-02 0:06 ` Jon Seymour
2011-05-02 0:12 ` Jon Seymour
2011-05-02 0:25 ` Jonathan Nieder
2011-05-02 3:47 ` Junio C Hamano
2011-05-02 5:15 ` Jonathan Nieder
2011-05-02 6:07 ` [PATCH] Documentation: clarify meaning of --html-path, --man-path, and --info-path Jonathan Nieder
2011-05-02 6:49 ` Jon Seymour
2011-05-02 17:24 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1304237785-56101-1-git-send-email-jon.seymour@gmail.com \
--to=jon.seymour@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).