ctucx.git: stagit

ctucx' stagit fork

commit 3ef3c3634d9b3349a0aceee382526df414514966
parent de4a14d2504ba36d0c4eea52a8f1978d6a180cc4
Author: Leah (ctucx) <leah@ctu.cx>
Date: Thu, 26 May 2022 18:01:30 +0200

stagit-index: add option '-n <value> to store a pagename
1 file changed, 11 insertions(+), 0 deletions(-)
M
stagit-index.c
|
11
+++++++++++
diff --git a/stagit-index.c b/stagit-index.c
@@ -13,6 +13,7 @@ static git_repository *repo;
 static const char *relpath = "";
 
 static char description[255] = "Oscar Benedito's Git repositories";
+static char *pagename = "";
 static char *name = "";
 static char owner[255];
 static char category[255];

@@ -196,9 +197,19 @@ main(int argc, char *argv[])
 		err(1, "pledge");
 #endif
 
+	if (!strcmp(argv[1], "-n")) {
+		if (2 == argc) err(1, "missing argument");
+		pagename = argv[2];
+	}
+
 	writeheader(stdout);
 
 	for (i = 1; i < argc; i++) {
+		if (!strcmp(argv[i], "-n")) {
+			i++;
+			continue;
+		}
+
 		if (!strcmp(argv[i], "-c")) {
 			i++;
 			if (i == argc)