tools: tweak help text
authorBartosz Golaszewski <bartekgola@gmail.com>
Mon, 16 Jan 2017 15:56:40 +0000 (16:56 +0100)
committerBartosz Golaszewski <bartekgola@gmail.com>
Mon, 16 Jan 2017 15:56:40 +0000 (16:56 +0100)
Also: stop processing the command line after a first non-option is
encountered in all tools.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
src/tools/gpiodetect.c
src/tools/gpiofind.c
src/tools/gpioget.c
src/tools/gpioinfo.c
src/tools/gpiomon.c
src/tools/gpioset.c

index 6291340a167ab8d0661744d17513e6da1d10e531..f94b17441ae53cafa8acfac687b727b81a1bb373 100644 (file)
@@ -25,8 +25,8 @@ static const char *const shortopts = "+hv";
 
 static void print_help(void)
 {
-       printf("Usage: %s <options>\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");
index 0467f58e74ed31ea2f75dffc1b0a2da1145c1bb6..aee6bccf6a22c2be8ad9657bef9b0e844755b2a0 100644 (file)
@@ -25,8 +25,8 @@ static const char *const shortopts = "+hv";
 
 static void print_help(void)
 {
-       printf("Usage: %s <options> [NAME]\n", get_progname());
-       printf("Find a GPIO line by name.\n");
+       printf("Usage: %s [OPTIONS] <name>\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");
index b7d4ac9d35c88bf25ac6f20e29fbf0045f4f1cfc..e0f20a480876a870d6b42e63b554941ef747ab02 100644 (file)
@@ -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] <options>\n",
+       printf("Usage: %s [OPTIONS] <chip name/number> <line offset>\n",
               get_progname());
        printf("Read value from a GPIO line\n");
        printf("Options:\n");
index d91c6ca4410adce219e870d534383177898b3f42..6d107295734bafd81549eaf306ab803154e502f4 100644 (file)
@@ -49,8 +49,8 @@ static const char *const shortopts = "+hv";
 
 static void print_help(void)
 {
-       printf("Usage: %s <options> [GPIOCHIP1...]\n", get_progname());
-       printf("List all lines of a GPIO chip.\n");
+       printf("Usage: %s [OPTIONS] <gpiochip1> ...\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");
index 48eaa65288cbd45f77671090198c20838a36a9d1..46cad7d8fba557d8233bee805fb8981528261ffe 100644 (file)
@@ -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] <options>\n",
+       printf("Usage: %s [OPTIONS] <chip name/number> <line offset>\n",
               get_progname());
        printf("Wait for events on a GPIO line\n");
        printf("Options:\n");
index 8ae288eb0c6f08d9b7e0b4777747df70b2152a81..434deab1be8300838fe0f46b867ec3862f1460e0 100644 (file)
@@ -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] <options>\n",
+       printf("Usage: %s [OPTIONS] <chip name/number> <line offset> <value>\n",
               get_progname());
        printf("Set value of a GPIO line\n");
        printf("Options:\n");