Imported Upstream version 3.3.1
[debian/amanda] / server-src / amflush.c
index 66bf6dc10af9e4e8532543b1dc1c1f338e50a949..8403ac2c277c29ba82c3f6a65843137858887f83 100644 (file)
 #include "holding.h"
 #include "server_util.h"
 #include "timestamp.h"
+#include "getopt.h"
+
+static struct option long_options[] = {
+    {"version"         , 0, NULL,  1},
+    {NULL, 0, NULL, 0}
+};
 
 static char *conf_logdir;
 FILE *driver_stream;
@@ -122,8 +128,12 @@ main(
     /* process arguments */
 
     cfg_ovr = new_config_overrides(argc/2);
-    while((opt = getopt(argc, argv, "bfso:D:")) != EOF) {
+    while((opt = getopt_long(argc, argv, "bfso:D:", long_options, NULL)) != EOF) {
        switch(opt) {
+       case 1  : printf("amflush-%s\n", VERSION);
+                 return(0);
+                 break;
+
        case 'b': batch = 1;
                  break;
        case 'f': foreground = 1;