diff options
author | Jonathan McCrohan <jmccrohan@gmail.com> | 2012-03-24 18:31:23 +0000 |
---|---|---|
committer | Jonathan McCrohan <jmccrohan@gmail.com> | 2012-03-24 18:34:54 +0000 |
commit | 886388f1449470b13b4f3749541314d34b6ef1c7 (patch) | |
tree | d6f13b1ebb9b6df9c45f60b858752370f79ac9ef | |
parent | 66c4eabaf093962ee343004e4c771f803dcab1de (diff) | |
download | verteco-886388f1449470b13b4f3749541314d34b6ef1c7.tar.gz |
ftphelper: add --version argument
-rw-r--r-- | src/ftphelper.c | 8 |
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; + } } |