tools: support --help in the ptraccel-debug tool

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit f545cfa923)
This commit is contained in:
Peter Hutterer 2016-11-02 11:19:28 +10:00
parent 4e48547047
commit 12b7ba7086

View file

@ -202,7 +202,8 @@ main(int argc, char **argv)
accel_profile_func_t profile = NULL;
enum {
OPT_MODE = 1,
OPT_HELP = 1,
OPT_MODE,
OPT_NEVENTS,
OPT_MAXDX,
OPT_STEP,
@ -215,6 +216,7 @@ main(int argc, char **argv)
int c;
int option_index = 0;
static struct option long_options[] = {
{"help", 0, 0, OPT_HELP },
{"mode", 1, 0, OPT_MODE },
{"nevents", 1, 0, OPT_NEVENTS },
{"maxdx", 1, 0, OPT_MAXDX },
@ -231,6 +233,10 @@ main(int argc, char **argv)
break;
switch (c) {
case OPT_HELP:
usage();
exit(0);
break;
case OPT_MODE:
if (streq(optarg, "accel"))
print_accel = true;