ctucx.git: stagit

ctucx' stagit fork

commit f819123d28f3eb07c78de48969897e202bdf6b7a
parent 94ff57d20ecb9c7248660a1dd91244706d035071
Author: Leah (ctucx) <leah@ctu.cx>
Date: Tue, 24 May 2022 14:41:52 +0200

implement option '-n <value>' to store a pagename
1 file changed, 5 insertions(+), 1 deletion(-)
M
stagit.c
|
6
+++++-
diff --git a/stagit.c b/stagit.c
@@ -64,6 +64,8 @@ static git_repository *repo;
 static const char *relpath = "";
 static const char *repodir;
 
+static char *pagename = "";
+
 static char *gen_time;
 static char *name = "";
 static char *strippedname = "";

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

@@ -1299,6 +1301,8 @@ main(int argc, char *argv[])
 			if (argv[i][0] == '\0' || *p != '\0' ||
 			    nlogcommits <= 0 || errno)
 				usage(argv[0]);
+		} else if (argv[i][1] == 'n') {
+			pagename = argv[++i];
 		}
 	}
 	if (!repodir)