diff recpt1/recpt1.c @ 43:9b36fdf7d5d0

show version option has been added
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Fri, 10 Jul 2009 22:36:06 +0900
parents a35e352f6c4a
children edd904628e2f
line wrap: on
line diff
--- a/recpt1/recpt1.c	Fri Jun 05 16:34:28 2009 +0900
+++ b/recpt1/recpt1.c	Fri Jul 10 22:36:06 2009 +0900
@@ -22,6 +22,7 @@
 
 #include "recpt1.h"
 #include "decoder.h"
+#include "version.h"
 
 /* maximum write length at once */
 #define SIZE_CHANK 1316
@@ -329,6 +330,7 @@
     fprintf(stderr, "  --port portnumber: Port number to connect\n");
     fprintf(stderr, "--device devicefile: Specify devicefile to use\n");
     fprintf(stderr, "--help:              Show this help\n");
+    fprintf(stderr, "--version:           Show version\n");
     fprintf(stderr, "\n");
 }
 void
@@ -540,6 +542,7 @@
         { "port",      1, NULL, 'p'},
         { "device",    1, NULL, 'd'},
         { "help",      0, NULL, 'h'},
+        { "version",   0, NULL, 'v'},
         {0, 0, NULL, 0} /* terminate */
     };
 
@@ -554,7 +557,7 @@
     char **tuner;
     int num_devs;
 
-    while((result = getopt_long(argc, argv, "br:smua:p:d:h",
+    while((result = getopt_long(argc, argv, "br:smua:p:d:hv",
                                 long_options, &option_index)) != -1) {
         switch(result) {
         case 'b':
@@ -580,6 +583,11 @@
             show_channels();
             exit(0);
             break;
+        case 'v':
+            fprintf(stderr, "%s %s\n", argv[0], version);
+            fprintf(stderr, "recorder command for PT1 digital tuner.\n");
+            exit(0);
+            break;
         /* following options require argument */
         case 'r':
             dopt.round = atoi(optarg);