diff options
author | Lars Wirzenius <liw@liw.fi> | 2012-06-05 15:03:26 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2012-06-05 15:03:26 +0100 |
commit | 563a442d63bab474b554453c6c3ccf10e3a5b48d (patch) | |
tree | e47030a2b80c19fa954cc958009360aba15d9c94 | |
parent | 3ebe87776f38e07343d79c14bc2dad3560bf5f8f (diff) |
Add --help and add --list to manpage
-rw-r--r-- | errno.c | 12 | ||||
-rw-r--r-- | errno.docbook | 15 |
2 files changed, 27 insertions, 0 deletions
@@ -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; diff --git a/errno.docbook b/errno.docbook index 0f3c241..64fd488 100644 --- a/errno.docbook +++ b/errno.docbook @@ -71,6 +71,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 <para> |