From: Junio C Hamano <junkio@cox.net>
To: exon@op5.se (Andreas Ericsson)
Cc: git@vger.kernel.org
Subject: Re: [PATCH 3/3] git --help COMMAND brings up the git-COMMAND man-page.
Date: Tue, 15 Nov 2005 15:49:18 -0800 [thread overview]
Message-ID: <7vsltxeakh.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20051115233125.2C0355BF73@nox.op5.se> (Andreas Ericsson's message of "Wed, 16 Nov 2005 00:31:25 +0100 (CET)")
exon@op5.se (Andreas Ericsson) writes:
> It's by design a bit stupid (matching ^git rather than ^git-), so as
> to work with 'gitk' and 'git' as well.
>
> Signed-off-by: Andreas Ericsson <ae@op5.se>
Thanks, stupid is fine.
> +/* has anyone seen 'man' installed anywhere else than in /usr/bin? */
> +#define PATH_TO_MAN "/usr/bin/man"
> +static void show_man_page(char *git_cmd)
> +{
> + char *page;
> +
> + if (!strncmp(git_cmd, "git", 3))
> + page = git_cmd;
> + else {
> + int page_len = strlen(git_cmd) + 4;
> +
> + page = malloc(page_len + 1);
> + strcpy(page, "git-");
> + strcpy(page + 4, git_cmd);
> + page[page_len] = 0;
> + }
> +
> + execlp(PATH_TO_MAN, "man", page, NULL);
> +}
If you do PATH_TO_MAN absolute, execl would suffice, but just
saying "man" and have execlp look for it would be easier to
manage.
next prev parent reply other threads:[~2005-11-15 23:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-15 23:31 [PATCH 3/3] git --help COMMAND brings up the git-COMMAND man-page Andreas Ericsson
2005-11-15 23:49 ` Junio C Hamano [this message]
2005-11-16 0:24 ` Andreas Ericsson
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=7vsltxeakh.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=exon@op5.se \
--cc=git@vger.kernel.org \
/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).