summaryrefslogtreecommitdiff
path: root/tools/hcidump.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-07-12 19:50:49 -0300
committerMarcel Holtmann <marcel@holtmann.org>2012-12-17 23:53:01 +0100
commit14e915fafd63962d08d4b9177bd01d25820de621 (patch)
tree2a93d552a6e3b972183abac2f95a22f3fa84056c /tools/hcidump.c
parent4f63d01dfd73eaaf78861677ab18a34617068827 (diff)
downloadbluez-14e915fafd63962d08d4b9177bd01d25820de621.tar.gz
hcidump: Add command for displaying hcidump version
Diffstat (limited to 'tools/hcidump.c')
-rw-r--r--tools/hcidump.c12
1 files 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);