Blob Blame History Raw
From 560e633910a28f81b6607cf81e53026ac96034bf Mon Sep 17 00:00:00 2001
From: Thomas Loimer <thomas.loimer@tuwien.ac.at>
Date: Sun, 15 Dec 2019 21:32:18 +0100
Subject: [PATCH 6/8] "fig2dev --version" prints version information

---
 fig2dev/fig2dev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fig2dev/fig2dev.c b/fig2dev/fig2dev.c
index 0866a71..479b484 100644
--- a/fig2dev/fig2dev.c
+++ b/fig2dev/fig2dev.c
@@ -218,6 +218,13 @@ get_args(int argc, char *argv[])
 
 	if (argc == 1)
 	    fprintf(stderr, Usage, prog, prog);
+
+	/* print the version, for the comfort of the autotest tests */
+	if (!strcmp(argv[1], "--version")) {
+		printf("fig2dev Version %s\n", PACKAGE_VERSION);
+		exit(EXIT_SUCCESS);
+	}
+
 	/* sum of all arguments */
 	while ((c = fig_getopt(argc, argv, ARGSTRING)) != EOF) {
 
-- 
2.24.1