summaryrefslogtreecommitdiff
path: root/monitor/main.c
diff options
context:
space:
mode:
authorGustavo Padovan <gustavo@padovan.org>2012-04-26 23:00:36 -0300
committerJohan Hedberg <johan.hedberg@intel.com>2012-04-27 15:16:05 +0300
commit4b93cdd7bea7b435bc7d34104999bbd2d838d077 (patch)
tree86f07f7c06d1e7a08aeabf3daeb0eb65ec88ffcf /monitor/main.c
parentdbe0ed14d5e12f76408e6f7f91ce6d3944fd2722 (diff)
downloadbluez-4b93cdd7bea7b435bc7d34104999bbd2d838d077.tar.gz
monitor: add help information
Diffstat (limited to 'monitor/main.c')
-rw-r--r--monitor/main.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/monitor/main.c b/monitor/main.c
index 9021133c6..3c4886f30 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;
}