ctucx.git: stagit

ctucx' stagit fork

commit a7d019f9a7d530d10344e7adc3883af45b2c651b
parent aef95980b41703beffc5569aba92f89055252074
Author: Leah (ctucx) <leah@ctu.cx>
Date: Tue, 24 May 2022 14:54:45 +0200

implement option '-h <value>' to store a http cloneurl
1 file changed, 4 insertions(+), 1 deletion(-)
M
stagit.c
|
5
++++-
diff --git a/stagit.c b/stagit.c
@@ -65,6 +65,7 @@ static const char *relpath = "";
 static const char *repodir;
 
 static char *pagename = "";
+static char *http_cloneurl = "";
 
 static char *gen_time;
 static char *name = "";

@@ -1252,7 +1253,7 @@ writerefs(FILE *fp)
 void
 usage(char *argv0)
 {
-	fprintf(stderr, "%s [-c cachefile | -l commits | -n pagename] "
+	fprintf(stderr, "%s [-c cachefile | -l commits | -n pagename | -h http_cloneurl ]"
 	        " repodir\n", argv0);
 	exit(1);
 }

@@ -1303,6 +1304,8 @@ main(int argc, char *argv[])
 				usage(argv[0]);
 		} else if (argv[i][1] == 'n') {
 			pagename = argv[++i];
+		} else if (argv[i][1] == 'h') {
+			http_cloneurl = argv[++i];
 		}
 	}
 	if (!repodir)