aboutsummaryrefslogtreecommitdiffstats
path: root/src/ftphelper.c
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2012-03-24 18:31:23 +0000
committerJonathan McCrohan <jmccrohan@gmail.com>2012-03-24 18:34:54 +0000
commit886388f1449470b13b4f3749541314d34b6ef1c7 (patch)
treed6f13b1ebb9b6df9c45f60b858752370f79ac9ef /src/ftphelper.c
parent66c4eabaf093962ee343004e4c771f803dcab1de (diff)
downloadverteco-886388f1449470b13b4f3749541314d34b6ef1c7.tar.gz
ftphelper: add --version argument
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;
+ }
}