summaryrefslogtreecommitdiff
path: root/src/sleep.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1993-10-17 03:57:04 +0000
committerJim Meyering <jim@meyering.net>1993-10-17 03:57:04 +0000
commitfa7a1e19e2b4fcec1f67ebd75f6f12ae65eef8c8 (patch)
treeffc67e10bcf805a9ee5b8243a5103f5bdb4fb90a /src/sleep.c
parent6e1a4cca6862fa1fb40b4c38b73fa30ebb61344b (diff)
downloadcoreutils-fa7a1e19e2b4fcec1f67ebd75f6f12ae65eef8c8.tar.xz
merge with 1.8.1g
Diffstat (limited to 'src/sleep.c')
-rw-r--r--src/sleep.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/sleep.c b/src/sleep.c
index f599a13c0..168c31b91 100644
--- a/src/sleep.c
+++ b/src/sleep.c
@@ -54,11 +54,28 @@ static struct option const long_options[] =
};
static void
-usage ()
+usage (status)
+ int status;
{
- fprintf (stderr, "Usage: %s [{--help,--version}] number[smhd]...\n",
+ fprintf (status == 0 ? stdout : stderr, "\
+Usage: %s [OPTION]... NUMBER[SUFFIX]\n\
+",
program_name);
- exit (1);
+
+ if (status != 0)
+ fprintf (stderr, "\nTry `%s --help' for more information.\n",
+ program_name);
+ else
+
+ printf ("\
+\n\
+ --help display this help and exit\n\
+ --version output version information and exit\n\
+\n\
+SUFFIX may be s for seconds, m for minutes, h for hours or d for days.\n\
+");
+
+ exit (status);
}
void
@@ -80,7 +97,7 @@ main (argc, argv)
break;
default:
- usage ();
+ usage (1);
}
}
@@ -91,7 +108,7 @@ main (argc, argv)
}
if (show_help)
- usage ();
+ usage (0);
if (argc == 1)
{