From 8f20b1fb8755e45297a98ca94f9736734d1b4f4c Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Mon, 6 Jun 2011 19:42:31 -0300 Subject: [PATCH] atrf-gpio: cleaned up usage - atrf-gpio.c (usage): added newline after synopsis - atrf-gpio.c (usage): description of option -p was missing - atrf-gpio.c (main): invocation without patterns/commands is now an error --- tools/atrf-gpio/atrf-gpio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/atrf-gpio/atrf-gpio.c b/tools/atrf-gpio/atrf-gpio.c index efffb35..3ba9c10 100644 --- a/tools/atrf-gpio/atrf-gpio.c +++ b/tools/atrf-gpio/atrf-gpio.c @@ -227,9 +227,10 @@ static void pass_fail(void) static void usage(const char *name) { fprintf(stderr, -"usage: %s [-c] [-d driver[:arg]] command|pattern ...\n" +"usage: %s [-c] [-d driver[:arg]] [-p] command|pattern ...\n\n" " -c cycle, waiting for Pass/Fail/Quit input\n" -" -d driver[:arg] use the specified driver (default: %s)\n\n" +" -d driver[:arg] use the specified driver (default: %s)\n" +" -p stay in P_ON state instead of entering TRX_OFF\n\n" " command is one of:\n" " reg=value set transceiver register\n" " reg:[value[/mask]]\n" @@ -290,6 +291,9 @@ int main(int argc, char *const *argv) usage(*argv); } + if (optind == argc) + usage(*argv); + for (i = optind; i != argc; i++) { if (*argv[i] == '#') continue;