}
}
+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' },
{ }
};
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;
case 'b':
btsnoop_open(optarg);
break;
+ case 'h':
+ usage();
+ return EXIT_SUCCESS;
default:
return EXIT_FAILURE;
}