Make integrity tests respect request ordering.
[nbd.git] / nbd-trdump.c
index 49f4f9e..1185224 100644 (file)
@@ -13,6 +13,8 @@
 #include <stdint.h>
 #include <unistd.h>
 #include "config.h"
+/* We don't want to do syslog output in this program */
+#undef ISSERVER
 #include "cliserv.h"
 #include "nbd.h"
 
@@ -43,6 +45,17 @@ int main(int argc, char**argv) {
        char * ctext;
        int readfd = 0; /* stdin */
 
+       if(argc > 1) {
+               int retval=0;
+               if(strcmp(argv[1], "--help") && strcmp(argv[1], "-h")) {
+                       printf("E: unknown option %s.\n", argv[1]);
+                       retval=1;
+               }
+               printf("This is nbd-trdump, part of nbd %s.\n", PACKAGE_VERSION);
+               printf("Use: %s < transactionlog\n", argv[0]);
+               return retval;
+       }
+
        while (1) {
                /* Read a request or reply from the transaction file */
                doread(readfd, &magic, sizeof(magic));