From: Lars Wirzenius Date: Tue, 5 Jun 2012 14:03:26 +0000 (+0100) Subject: Add --help and add --list to manpage X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=563a442d63bab474b554453c6c3ccf10e3a5b48d;p=moreutils Add --help and add --list to manpage --- diff --git a/errno.c b/errno.c index f1e2285..3b981ce 100644 --- 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; diff --git a/errno.docbook b/errno.docbook index 0f3c241..64fd488 100644 --- a/errno.docbook +++ b/errno.docbook @@ -70,6 +70,21 @@ with this program; if not, write to the Free Software Foundation, Inc., + + OPTIONS + + + + + + + List all errno values. + + + + + + AUTHOR Lars Wirzenius