Re: [PATCH 1/2] Show html help with git-help --html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nguyen Thai Ngoc Duy <pclouds@xxxxxxxxx> writes:

> This patch was inspired by ClearCase command 'ct man',...

> diff --git a/help.c b/help.c
> index 6a9af4d..78b1023 100644
> --- a/help.c
> +++ b/help.c
> @@ -9,6 +9,14 @@
>  #include "common-cmds.h"
>  #include <sys/ioctl.h>
>  
> +#ifndef HTML_DIR
> +#define HTML_DIR "/usr/share/html/"
> +#endif
> +
> +#ifndef HTML_PROGRAM
> +#define HTML_PROGRAM "xdg-open"
> +#endif
> +
>  /* most GUI terminals set COLUMNS (although some don't export it) */
>  static int term_columns(void)
>  {
> @@ -183,6 +191,145 @@ static void show_man_page(const char *git_cmd)
>  	execlp("man", "man", page, NULL);
>  }
>  
> +static void show_html_page(const char *git_cmd)
> +{
> +	const char *html_dir;
> +	int len, ret, nr_quotes;
> +	char *p, *p2;
> +	const char *cp, *cp2;
> +	struct stat st;
> +	char *quoted_git_cmd;
> +	char *default_command = NULL;
> +	const char *command;
>...
> +	/* append %p if there is not any %x */
> +	if (!strchr(command, '%')) {
> +		len = strlen(command);
> +		default_command = xmalloc(len + 3 + 1); /* space %p */
> +		strcpy(default_command, command);
> +		strcat(default_command, " %p");
> +		command = default_command;
> +	}
> +
> +	/* first pass, calculate command length */
> ...

Hmmm.  Makes one wonder why interpolate is not used....

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux