Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 2/3] git-help: add -w|--web option to display html man page in a browser.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:56

Christian Couder [off-list ref] writes:
quoted hunk
diff --git a/help.c b/help.c
index 0f1cb71..ecc8c66 100644
--- a/help.c
+++ b/help.c
@@ -297,7 +303,14 @@ int cmd_help(int argc, const char **argv, const char *prefix)
 	const char *help_cmd = argc > 1 ? argv[1] : NULL;
 	check_help_cmd(help_cmd);
 
-	if (!strcmp(help_cmd, "--info") || !strcmp(help_cmd, "-i")) {
+	if (!strcmp(help_cmd, "--web") || !strcmp(help_cmd, "-w")) {
+		help_cmd = argc > 2 ? argv[2] : NULL;
+		check_help_cmd(help_cmd);
+
+		show_html_page(help_cmd);
+	}
+
+	else if (!strcmp(help_cmd, "--info") || !strcmp(help_cmd, "-i")) {
 		help_cmd = argc > 2 ? argv[2] : NULL;
 		check_help_cmd(help_cmd);
Isn't this "check-help-cmd" duplication ugly, by the way?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help