summaryrefslogtreecommitdiff
path: root/errno.c
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2012-06-05 15:03:26 +0100
committerLars Wirzenius <liw@liw.fi>2012-06-05 15:03:26 +0100
commit563a442d63bab474b554453c6c3ccf10e3a5b48d (patch)
treee47030a2b80c19fa954cc958009360aba15d9c94 /errno.c
parent3ebe87776f38e07343d79c14bc2dad3560bf5f8f (diff)
downloadmoreutils-563a442d63bab474b554453c6c3ccf10e3a5b48d.tar.gz
Add --help and add --list to manpage
Diffstat (limited to 'errno.c')
-rw-r--r--errno.c12
1 files changed, 12 insertions, 0 deletions
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;