From: Bartosz Golaszewski Date: Mon, 16 Jan 2017 15:56:40 +0000 (+0100) Subject: tools: tweak help text X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d59806b8c30223132cceda288c9961e806e52fbf;p=qemu-gpiodev%2Flibgpiod.git tools: tweak help text Also: stop processing the command line after a first non-option is encountered in all tools. Signed-off-by: Bartosz Golaszewski --- diff --git a/src/tools/gpiodetect.c b/src/tools/gpiodetect.c index 6291340..f94b174 100644 --- a/src/tools/gpiodetect.c +++ b/src/tools/gpiodetect.c @@ -25,8 +25,8 @@ static const char *const shortopts = "+hv"; static void print_help(void) { - printf("Usage: %s \n", get_progname()); - printf("List all GPIO chips\n"); + printf("Usage: %s [OPTIONS]\n", get_progname()); + printf("List all GPIO chips, print their labels and number of GPIO lines.\n"); printf("Options:\n"); printf(" -h, --help:\t\tdisplay this message and exit\n"); printf(" -v, --version:\tdisplay the version and exit\n"); diff --git a/src/tools/gpiofind.c b/src/tools/gpiofind.c index 0467f58..aee6bcc 100644 --- a/src/tools/gpiofind.c +++ b/src/tools/gpiofind.c @@ -25,8 +25,8 @@ static const char *const shortopts = "+hv"; static void print_help(void) { - printf("Usage: %s [NAME]\n", get_progname()); - printf("Find a GPIO line by name.\n"); + printf("Usage: %s [OPTIONS] \n", get_progname()); + printf("Find a GPIO line by name. The output of this command can be used as input for gpioget/set.\n"); printf("Options:\n"); printf(" -h, --help:\t\tdisplay this message and exit\n"); printf(" -v, --version:\tdisplay the version and exit\n"); diff --git a/src/tools/gpioget.c b/src/tools/gpioget.c index b7d4ac9..e0f20a4 100644 --- a/src/tools/gpioget.c +++ b/src/tools/gpioget.c @@ -22,11 +22,11 @@ static const struct option longopts[] = { { 0 }, }; -static const char *const shortopts = "hvl"; +static const char *const shortopts = "+hvl"; static void print_help(void) { - printf("Usage: %s [CHIP NAME/NUMBER] [LINE OFFSET] \n", + printf("Usage: %s [OPTIONS] \n", get_progname()); printf("Read value from a GPIO line\n"); printf("Options:\n"); diff --git a/src/tools/gpioinfo.c b/src/tools/gpioinfo.c index d91c6ca..6d10729 100644 --- a/src/tools/gpioinfo.c +++ b/src/tools/gpioinfo.c @@ -49,8 +49,8 @@ static const char *const shortopts = "+hv"; static void print_help(void) { - printf("Usage: %s [GPIOCHIP1...]\n", get_progname()); - printf("List all lines of a GPIO chip.\n"); + printf("Usage: %s [OPTIONS] ...\n", get_progname()); + printf("Print information about all lines of the specified GPIO chip(s) (or all gpiochips if none are specified).\n"); printf("Options:\n"); printf(" -h, --help:\t\tdisplay this message and exit\n"); printf(" -v, --version:\tdisplay the version and exit\n"); diff --git a/src/tools/gpiomon.c b/src/tools/gpiomon.c index 48eaa65..46cad7d 100644 --- a/src/tools/gpiomon.c +++ b/src/tools/gpiomon.c @@ -23,11 +23,11 @@ static const struct option longopts[] = { { 0 }, }; -static const char *const shortopts = "hvl"; +static const char *const shortopts = "+hvl"; static void print_help(void) { - printf("Usage: %s [CHIP NAME/NUMBER] [LINE OFFSET] \n", + printf("Usage: %s [OPTIONS] \n", get_progname()); printf("Wait for events on a GPIO line\n"); printf("Options:\n"); diff --git a/src/tools/gpioset.c b/src/tools/gpioset.c index 8ae288e..434deab 100644 --- a/src/tools/gpioset.c +++ b/src/tools/gpioset.c @@ -22,11 +22,11 @@ static const struct option longopts[] = { { 0 }, }; -static const char *const shortopts = "hvl"; +static const char *const shortopts = "+hvl"; static void print_help(void) { - printf("Usage: %s [CHIP NAME/NUMBER] [LINE OFFSET] [VALUE] \n", + printf("Usage: %s [OPTIONS] \n", get_progname()); printf("Set value of a GPIO line\n"); printf("Options:\n");