]> err.no Git - moreutils/commitdiff
Add --help and add --list to manpage
authorLars Wirzenius <liw@liw.fi>
Tue, 5 Jun 2012 14:03:26 +0000 (15:03 +0100)
committerLars Wirzenius <liw@liw.fi>
Tue, 5 Jun 2012 14:03:26 +0000 (15:03 +0100)
errno.c
errno.docbook

diff --git a/errno.c b/errno.c
index f1e2285fd56378bc1898117e6c22994c9a708c48..3b981cec8b87dd083b281de3a4ca976892b952e1 100644 (file)
--- a/errno.c
+++ b/errno.c
@@ -74,10 +74,18 @@ report_from_code(int code)
 
 static struct option
 options[] = {
+    { "help", 0, NULL, 'h' },
     { "list", 0, NULL, 'l' },
 };
 
 
+static void
+usage(void)
+{
+    printf("Usage: errno [-l] [--list] [keyword]\n");
+}
+
+
 int 
 main(int argc, char **argv)
 {
@@ -92,6 +100,10 @@ main(int argc, char **argv)
             break;
             
         switch (c) {
+        case 'h':
+            usage();
+            return EXIT_SUCCESS;
+
         case 'l':
             mode = list_mode;
             break;
index 0f3c241c5c8af0030b2dc7cc160f99f2aa5346f4..64fd48808e16247821e22dfa9978566466056f0b 100644 (file)
@@ -70,6 +70,21 @@ with this program; if not, write to the Free Software Foundation, Inc.,
                
        </refsect1>
        
+       <refsect1>
+        <title>OPTIONS</title>
+        
+        <variablelist>
+            <varlistentry>
+                <term><option>-l</option></term>
+                <term><option>--list</option></term>
+                <listitem>
+                    <para>List all errno values.</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+
+       </refsect1>
+       
        <refsect1>
                <title>AUTHOR</title>
                        Lars Wirzenius