]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
added rcsid
authorhadaq <hadaq>
Wed, 2 Sep 2009 22:09:27 +0000 (22:09 +0000)
committerhadaq <hadaq>
Wed, 2 Sep 2009 22:09:27 +0000 (22:09 +0000)
trbrich/trb_i2c.c

index 3cf7ef243d2d2169dc584d164cfff001c4f4bab1..bf9509a05d991025ff6f034ffd548a8a092ebf01 100644 (file)
@@ -12,6 +12,8 @@
 
 #define BUFFER_SIZE 4096
 
+static const char trb_i2c_version[] = "$Revision: 1.3 $"; 
+
 static const uint16_t trb_i2c_register = 0x8040;
 
 static const unsigned int timeout = 1000;
@@ -22,6 +24,7 @@ void usage(const char *progName)
   printf("Options:\n");
   printf("  -h    give this help\n");
   printf("  -d    turn on Debugging Information\n");
+  printf("  -V    Version number\n");
   printf("\nCommands:\n");
   printf("   w <trb_address> <chip> <register> <value> -> "
          "write <value> to <register>\n"); 
@@ -131,7 +134,7 @@ int main(int argc, char** argv)
   trb_lazy = 0;
   
   /* Parse Arguments */
-  while ((i = getopt(argc, argv, "+hd:")) != -1) {
+  while ((i = getopt(argc, argv, "+hd:V")) != -1) {
     switch (i) {
     case '?':
       usage(basename(argv[0]));
@@ -142,6 +145,11 @@ int main(int argc, char** argv)
     case 'd':
       trb_debug = strtoul(optarg, NULL, 0);
       break;
+    case 'V':
+      printf("%s %s, using libtrbnet %s\n",
+             basename(argv[0]), trb_i2c_version, trbnet_version);
+      exit(EXIT_SUCCESS);
+      break;
     default:
       break;
     }