summaryrefslogtreecommitdiff
path: root/src/nice.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/nice.c
parent6e1a4cca6862fa1fb40b4c38b73fa30ebb61344b (diff)
downloadcoreutils-fa7a1e19e2b4fcec1f67ebd75f6f12ae65eef8c8.tar.xz
merge with 1.8.1g
Diffstat (limited to 'src/nice.c')
-rw-r--r--src/nice.c34
1 files changed, 26 insertions, 8 deletions
diff --git a/src/nice.c b/src/nice.c
index 3cdc073f0..74bac8835 100644
--- a/src/nice.c
+++ b/src/nice.c
@@ -86,7 +86,7 @@ main (argc, argv)
switch (optc)
{
case '?':
- usage ();
+ usage (1);
case 0:
break;
@@ -115,7 +115,7 @@ main (argc, argv)
}
if (show_help)
- usage ();
+ usage (0);
if (minusflag)
adjustment = -adjustment;
@@ -125,7 +125,7 @@ main (argc, argv)
if (optind == argc)
{
if (adjustment_given)
- usage ();
+ usage (1);
/* No command given; print the priority. */
errno = 0;
current_priority = GET_PRIORITY ();
@@ -171,11 +171,29 @@ isinteger (s)
}
static void
-usage ()
+usage (status)
+ int status;
{
- fprintf (stderr, "\
-Usage: %s [-n adjustment] [-adjustment] [--adjustment=adjustment]\n\
- [command [arg...]]\n",
+ fprintf (status == 0 ? stdout : stderr, "\
+Usage: %s [OPTION]... [COMMAND [ARG]...]\n\
+",
program_name);
- exit (1);
+
+ if (status != 0)
+ fprintf (stderr, "\nTry `%s --help' for more information.\n",
+ program_name);
+ else
+
+ printf ("\
+\n\
+ -ADJUST increment priority by ADJUST first\n\
+ -n, --adjustment ADJUST same as -ADJUST\n\
+ --help display this help and exit\n\
+ --version output version information and exit\n\
+\n\
+With no COMMAND, print the current scheduling priority. ADJUST is 10\n\
+by default. Range goes from -20 (highest priority) to 19 (lowest).\n\
+");
+
+ exit (status);
}