[waffle] [PATCH] wfinfo: Add short option -h for --help

Chad Versace chad.versace at linux.intel.com
Fri Feb 7 09:49:32 PST 2014


Document it in the manpage too.

CC: Jordan Justen <jordan.l.justen at intel.com>
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 man/wflinfo.1.xml   | 1 +
 src/utils/wflinfo.c | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/man/wflinfo.1.xml b/man/wflinfo.1.xml
index e2a590d..a5f1715 100644
--- a/man/wflinfo.1.xml
+++ b/man/wflinfo.1.xml
@@ -147,6 +147,7 @@
         </listitem>
       </varlistentry>
       <varlistentry>
+        <term><option>-h</option></term>
         <term><option>--help</option></term>
         <listitem>
           <para>
diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c
index dd70a4e..07f3513 100644
--- a/src/utils/wflinfo.c
+++ b/src/utils/wflinfo.c
@@ -83,7 +83,7 @@ static const char *usage_message =
     "    --debug-context\n"
     "        Create a debug context.\n"
     "\n"
-    "    --help\n"
+    "    -h, --help\n"
     "        Print wflinfo usage information.\n"
     "\n"
     "Examples:\n"
@@ -102,7 +102,7 @@ enum {
     OPT_VERBOSE = 'v',
     OPT_DEBUG_CONTEXT,
     OPT_FORWARD_COMPATIBLE,
-    OPT_HELP,
+    OPT_HELP = 'h',
 };
 
 static const struct option get_opts[] = {
@@ -319,7 +319,7 @@ parse_args(int argc, char *argv[], struct options *opts)
     opterr = 0;
 
     while (loop_get_opt) {
-        int opt = getopt_long(argc, argv, "a:p:vV:", get_opts, NULL);
+        int opt = getopt_long(argc, argv, "a:hp:vV:", get_opts, NULL);
         switch (opt) {
             case -1:
                 loop_get_opt = false;
-- 
1.8.5.3



More information about the waffle mailing list