* [PATCH 1/2] monitor: add help information
@ 2012-04-27 2:00 Gustavo Padovan
2012-04-27 2:00 ` [PATCH 2/2] monitor: add version information Gustavo Padovan
2012-04-27 12:16 ` [PATCH 1/2] monitor: add help information Johan Hedberg
0 siblings, 2 replies; 3+ messages in thread
From: Gustavo Padovan @ 2012-04-27 2:00 UTC (permalink / raw)
To: linux-bluetooth
---
monitor/main.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/monitor/main.c b/monitor/main.c
index 9021133..3c4886f 100644
--- a/monitor/main.c
+++ b/monitor/main.c
@@ -46,8 +46,19 @@ static void signal_callback(int signum, void *user_data)
}
}
+static void usage(void)
+{
+ printf("btmon - Bluetooth monitor\n"
+ "Usage:\n");
+ printf("\tbtmon [options]\n");
+ printf("options:\n"
+ "\t-b, --btsnoop <file> Save dump in btsnoop format\n"
+ "\t-h, --help Show help options\n");
+}
+
static const struct option main_options[] = {
{ "btsnoop", required_argument, NULL, 'b' },
+ { "help", no_argument, NULL, 'h' },
{ }
};
@@ -61,7 +72,7 @@ int main(int argc, char *argv[])
for (;;) {
int opt;
- opt = getopt_long(argc, argv, "b", main_options, NULL);
+ opt = getopt_long(argc, argv, "bh", main_options, NULL);
if (opt < 0)
break;
@@ -69,6 +80,9 @@ int main(int argc, char *argv[])
case 'b':
btsnoop_open(optarg);
break;
+ case 'h':
+ usage();
+ return EXIT_SUCCESS;
default:
return EXIT_FAILURE;
}
--
1.7.10
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] monitor: add version information
2012-04-27 2:00 [PATCH 1/2] monitor: add help information Gustavo Padovan
@ 2012-04-27 2:00 ` Gustavo Padovan
2012-04-27 12:16 ` [PATCH 1/2] monitor: add help information Johan Hedberg
1 sibling, 0 replies; 3+ messages in thread
From: Gustavo Padovan @ 2012-04-27 2:00 UTC (permalink / raw)
To: linux-bluetooth
---
monitor/main.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/monitor/main.c b/monitor/main.c
index 3c4886f..4e8b433 100644
--- a/monitor/main.c
+++ b/monitor/main.c
@@ -58,6 +58,7 @@ static void usage(void)
static const struct option main_options[] = {
{ "btsnoop", required_argument, NULL, 'b' },
+ { "version", no_argument, NULL, 'v' },
{ "help", no_argument, NULL, 'h' },
{ }
};
@@ -72,7 +73,7 @@ int main(int argc, char *argv[])
for (;;) {
int opt;
- opt = getopt_long(argc, argv, "bh", main_options, NULL);
+ opt = getopt_long(argc, argv, "bvh", main_options, NULL);
if (opt < 0)
break;
@@ -80,6 +81,9 @@ int main(int argc, char *argv[])
case 'b':
btsnoop_open(optarg);
break;
+ case 'v':
+ printf("%s\n", VERSION);
+ return EXIT_SUCCESS;
case 'h':
usage();
return EXIT_SUCCESS;
--
1.7.10
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] monitor: add help information
2012-04-27 2:00 [PATCH 1/2] monitor: add help information Gustavo Padovan
2012-04-27 2:00 ` [PATCH 2/2] monitor: add version information Gustavo Padovan
@ 2012-04-27 12:16 ` Johan Hedberg
1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2012-04-27 12:16 UTC (permalink / raw)
To: Gustavo Padovan; +Cc: linux-bluetooth
Hi Gustavo,
On Thu, Apr 26, 2012, Gustavo Padovan wrote:
> ---
> monitor/main.c | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
Both patches have been applied. Thanks.
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-04-27 12:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-27 2:00 [PATCH 1/2] monitor: add help information Gustavo Padovan
2012-04-27 2:00 ` [PATCH 2/2] monitor: add version information Gustavo Padovan
2012-04-27 12:16 ` [PATCH 1/2] monitor: add help information Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).