aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-07-12 19:50:49 -0300
committerMarcel Holtmann <marcel@holtmann.org>2010-07-12 19:50:49 -0300
commit74082fe58dda211123657f55a51dcaac65798fea (patch)
tree8863830f945a7342a783c2ae6f0899a4b70721e5
parente29ef1c435c2750145e06a86395daa23d440d4d7 (diff)
downloadbluez-hcidump-74082fe58dda211123657f55a51dcaac65798fea.tar.gz
bluez-hcidump-74082fe58dda211123657f55a51dcaac65798fea.tar.xz
bluez-hcidump-74082fe58dda211123657f55a51dcaac65798fea.zip
Add command for displaying hcidump version
-rw-r--r--src/hcidump.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/hcidump.c b/src/hcidump.c
index 6d84afa..33ca1bc 100644
--- a/src/hcidump.c
+++ b/src/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);