aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ftphelper.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ftphelper.c b/src/ftphelper.c
index fae3771..69527db 100644
--- a/src/ftphelper.c
+++ b/src/ftphelper.c
@@ -19,6 +19,10 @@
// gcc ftphelper.c -o ftphelper `pkg-config --libs --cflags libconfig`
+#ifndef VERSION_STRING
+#define VERSION_STRING "[undefined version]"
+#endif
+
#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/types.h>
@@ -102,4 +106,8 @@ int main(int argc, char *argv[]) {
printf("%s", ftp_directory);
return 0;
}
+ if (strcmp(argv[1], "--version") == 0) {
+ printf("%s", VERSION_STRING);
+ return 0;
+ }
}