From 563a442d63bab474b554453c6c3ccf10e3a5b48d Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 5 Jun 2012 15:03:26 +0100 Subject: [PATCH] Add --help and add --list to manpage --- errno.c | 12 ++++++++++++ errno.docbook | 15 +++++++++++++++ 2 files changed, 27 insertions(+) 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 -- 2.39.5