From 14e915fafd63962d08d4b9177bd01d25820de621 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 12 Jul 2010 19:50:49 -0300 Subject: [PATCH] hcidump: Add command for displaying hcidump version --- tools/hcidump.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/hcidump.c b/tools/hcidump.c index d7da94331..7d312c8a4 100644 --- a/tools/hcidump.c +++ b/tools/hcidump.c @@ -876,6 +876,7 @@ static void usage(void) " -4, --ipv4 Use IPv4 as transport\n" " -6 --ipv6 Use IPv6 as transport\n" " -h, --help Give this help list\n" + " -v, --version Give version information\n" " --usage Give a short usage message\n" ); } @@ -904,6 +905,7 @@ static struct option main_options[] = { { "ipv4", 0, 0, '4' }, { "ipv6", 0, 0, '6' }, { "help", 0, 0, 'h' }, + { "version", 0, 0, 'v' }, { 0 } }; @@ -916,9 +918,7 @@ int main(int argc, char *argv[]) int defcompid = DEFAULT_COMPID; int opt, pppdump_fd = -1, audio_fd = -1; - printf("HCI sniffer - Bluetooth packet analyzer ver %s\n", VERSION); - - while ((opt=getopt_long(argc, argv, "i:l:p:m:w:r:d:taxXRC:H:O:P:D:A:BVYZN46h", main_options, NULL)) != -1) { + while ((opt=getopt_long(argc, argv, "i:l:p:m:w:r:d:taxXRC:H:O:P:D:A:BVYZN46hv", main_options, NULL)) != -1) { switch(opt) { case 'i': if (strcasecmp(optarg, "none") && strcasecmp(optarg, "system")) @@ -1014,6 +1014,10 @@ int main(int argc, char *argv[]) af = AF_INET6; break; + case 'v': + printf("%s\n", VERSION); + exit(0); + case 'h': default: usage(); @@ -1025,6 +1029,8 @@ int main(int argc, char *argv[]) argv += optind; optind = 0; + printf("HCI sniffer - Bluetooth packet analyzer ver %s\n", VERSION); + if (argc > 0) filter = parse_filter(argc, argv); -- 2.47.3