2011-12-20 13:47:13

by Szymon Janc

[permalink] [raw]
Subject: [PATCH hcidump] Restore --verbose/-V option

Ignore --verbose and -V options instead of printing usage info. This
is for compatibility with hcidump 1.x to not break scripts.
---
src/hcidump.8 | 3 +++
src/hcidump.c | 6 +++++-
2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/hcidump.8 b/src/hcidump.8
index aa91b81..db4b4fc 100644
--- a/src/hcidump.8
+++ b/src/hcidump.8
@@ -102,6 +102,9 @@ Extract PPP traffic with pppdump format.
.BR -A ", " "\-\^\-audio=" "<file>"
Extract SCO audio data.
.TP
+.BR -V ", " "\-\^\-verbose"
+Ignored.
+.TP
.BR -Y ", " "\-\^\-novendor"
Don't display any vendor commands or events and don't show any pin code or link key in plain text.
.TP
diff --git a/src/hcidump.c b/src/hcidump.c
index 0c13360..a738c07 100644
--- a/src/hcidump.c
+++ b/src/hcidump.c
@@ -893,6 +893,7 @@ static struct option main_options[] = {
{ "ipv6", 0, 0, '6' },
{ "help", 0, 0, 'h' },
{ "version", 0, 0, 'v' },
+ { "verbose", 0, 0, 'V' },
{ 0 }
};

@@ -905,7 +906,7 @@ int main(int argc, char *argv[])
int defcompid = DEFAULT_COMPID;
int opt, pppdump_fd = -1, audio_fd = -1;

- while ((opt=getopt_long(argc, argv, "i:l:p:m:w:r:d:taxXRC:H:O:P:D:A:YZ46hv", main_options, NULL)) != -1) {
+ while ((opt=getopt_long(argc, argv, "i:l:p:m:w:r:d:taxXRC:H:O:P:D:A:YZ46hvV", main_options, NULL)) != -1) {
switch(opt) {
case 'i':
if (strcasecmp(optarg, "none") && strcasecmp(optarg, "system"))
@@ -1005,6 +1006,9 @@ int main(int argc, char *argv[])
printf("%s\n", VERSION);
exit(0);

+ case 'V':
+ break;
+
case 'h':
default:
usage();
--
on behalf of ST-Ericsson



2011-12-20 16:53:53

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH hcidump] Restore --verbose/-V option

Hi Szymon,

> Ignore --verbose and -V options instead of printing usage info. This
> is for compatibility with hcidump 1.x to not break scripts.

it is a new major version and scripts will break eventually. You are
just trying to delay this. And when I make 3.x and then the same patch
will come up again. You might wanna look into a tool called sed ;)

Regards

Marcel



2011-12-20 15:47:26

by Gustavo Padovan

[permalink] [raw]
Subject: Re: [PATCH hcidump] Restore --verbose/-V option

Hi Szymon,

* Szymon Janc <[email protected]> [2011-12-20 14:47:13 +0100]:

> Ignore --verbose and -V options instead of printing usage info. This
> is for compatibility with hcidump 1.x to not break scripts.

Why do we need to keep compatibility between major versions?
If the -V option means nothing we should inform the user about that and show
hem the help.

Gustavo