Mercurial > pt1.oyama
comparison 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 |
comparison
equal
deleted
inserted
replaced
42:a35e352f6c4a | 43:9b36fdf7d5d0 |
---|---|
20 #include <sys/ioctl.h> | 20 #include <sys/ioctl.h> |
21 #include "pt1_ioctl.h" | 21 #include "pt1_ioctl.h" |
22 | 22 |
23 #include "recpt1.h" | 23 #include "recpt1.h" |
24 #include "decoder.h" | 24 #include "decoder.h" |
25 #include "version.h" | |
25 | 26 |
26 /* maximum write length at once */ | 27 /* maximum write length at once */ |
27 #define SIZE_CHANK 1316 | 28 #define SIZE_CHANK 1316 |
28 | 29 |
29 /* globals */ | 30 /* globals */ |
327 fprintf(stderr, "--udp: Turn on udp broadcasting\n"); | 328 fprintf(stderr, "--udp: Turn on udp broadcasting\n"); |
328 fprintf(stderr, " --addr hostname: Hostname or address to connect\n"); | 329 fprintf(stderr, " --addr hostname: Hostname or address to connect\n"); |
329 fprintf(stderr, " --port portnumber: Port number to connect\n"); | 330 fprintf(stderr, " --port portnumber: Port number to connect\n"); |
330 fprintf(stderr, "--device devicefile: Specify devicefile to use\n"); | 331 fprintf(stderr, "--device devicefile: Specify devicefile to use\n"); |
331 fprintf(stderr, "--help: Show this help\n"); | 332 fprintf(stderr, "--help: Show this help\n"); |
333 fprintf(stderr, "--version: Show version\n"); | |
332 fprintf(stderr, "\n"); | 334 fprintf(stderr, "\n"); |
333 } | 335 } |
334 void | 336 void |
335 show_channels(void) | 337 show_channels(void) |
336 { | 338 { |
538 { "udp", 0, NULL, 'u'}, | 540 { "udp", 0, NULL, 'u'}, |
539 { "addr", 1, NULL, 'a'}, | 541 { "addr", 1, NULL, 'a'}, |
540 { "port", 1, NULL, 'p'}, | 542 { "port", 1, NULL, 'p'}, |
541 { "device", 1, NULL, 'd'}, | 543 { "device", 1, NULL, 'd'}, |
542 { "help", 0, NULL, 'h'}, | 544 { "help", 0, NULL, 'h'}, |
545 { "version", 0, NULL, 'v'}, | |
543 {0, 0, NULL, 0} /* terminate */ | 546 {0, 0, NULL, 0} /* terminate */ |
544 }; | 547 }; |
545 | 548 |
546 int use_b25 = FALSE; | 549 int use_b25 = FALSE; |
547 int use_udp = FALSE; | 550 int use_udp = FALSE; |
552 sock_data *sockdata = NULL; | 555 sock_data *sockdata = NULL; |
553 char *device = NULL; | 556 char *device = NULL; |
554 char **tuner; | 557 char **tuner; |
555 int num_devs; | 558 int num_devs; |
556 | 559 |
557 while((result = getopt_long(argc, argv, "br:smua:p:d:h", | 560 while((result = getopt_long(argc, argv, "br:smua:p:d:hv", |
558 long_options, &option_index)) != -1) { | 561 long_options, &option_index)) != -1) { |
559 switch(result) { | 562 switch(result) { |
560 case 'b': | 563 case 'b': |
561 use_b25 = TRUE; | 564 use_b25 = TRUE; |
562 fprintf(stderr, "using B25...\n"); | 565 fprintf(stderr, "using B25...\n"); |
576 break; | 579 break; |
577 case 'h': | 580 case 'h': |
578 show_usage(argv[0]); | 581 show_usage(argv[0]); |
579 show_options(); | 582 show_options(); |
580 show_channels(); | 583 show_channels(); |
584 exit(0); | |
585 break; | |
586 case 'v': | |
587 fprintf(stderr, "%s %s\n", argv[0], version); | |
588 fprintf(stderr, "recorder command for PT1 digital tuner.\n"); | |
581 exit(0); | 589 exit(0); |
582 break; | 590 break; |
583 /* following options require argument */ | 591 /* following options require argument */ |
584 case 'r': | 592 case 'r': |
585 dopt.round = atoi(optarg); | 593 dopt.round = atoi(optarg); |