]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
renice: accept also -V for --version, and document it
authorBenno Schulenberg <bensberg@justemail.net>
Mon, 6 Feb 2012 16:48:25 +0000 (17:48 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 25 Jan 2013 10:47:33 +0000 (11:47 +0100)
Also improve the man page.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
sys-utils/renice.1
sys-utils/renice.c

index afffd9e1b53d5a0b38a5e60973b133e113f0cb2f..705138cf6c5537c8966573db725a107531b2cee0 100644 (file)
 renice \- alter priority of running processes
 .SH SYNOPSIS
 .B renice
--n priority [options] <pid> [...]
+.RB [ \-n ]
+.I priority
+.RB [ \-gpu ]
+.IR identifier ...
 .SH DESCRIPTION
-.B Renice
+.B renice
 alters the scheduling priority of one or more running processes.  The
-following
-.I who
-parameters are interpreted as process ID's, process group ID's, or user
-names.
-.BR Renice 'ing
+first argument is the \fIpriority\fR value to be used.
+The other arguments are interpreted as process IDs (by default),
+process group IDs, user IDs, or user names.
+.BR renice 'ing
 a process group causes all processes in the process group to have their
 scheduling priority altered.
-.BR Renice 'ing
+.BR renice 'ing
 a user causes all processes owned by the user to have their scheduling
-priority altered.  By default, the processes to be affected are specified by
-their process ID's.
+priority altered.
 .PP
 .SH OPTIONS
 .TP
-\fB\-n\fR, \fB\-\-priority\fR \fIpriority\fR
-The scheduling
+.BR \-n , " \-\-priority " \fIpriority\fR
+Specify the scheduling
 .I priority
-of the process, process group, or user.  Use of
+to be used for the process, process group, or user.  Use of the option
 .BR \-n " or " \-\-priority
-can only exist as the first argument of
-.B renice
-command.
+is optional, but when used it must be the first argument.
 .TP
-\fB\-g\fR, \fB\-\-pgrp\fR \fIpgid\fR
-Force
-.I who
-parameters to be interpreted as \fIprocess group ID\fR's.
+.BR \-g , " \-\-pgrp " \fIpgid\fR...
+Force the succeeding arguments to be interpreted as process group IDs.
 .TP
-\fB\-u\fR, \fB\-\-user\fR \fIname\fR or \fIuid\fR
-Force the
-.I who
-parameters to be interpreted as \fIuser name\fR or \fIid\fR.
+.BR \-u , " \-\-user " \fIname_or_uid\fR...
+Force the succeeding arguments to be interpreted as usernames or UIDs.
 .TP
-\fB\-p\fR, \fB\-\-pid\fR \fIprocess id\fR
-Resets the
-.I who
-interpretation to be (the default) \fIprocess ID\fR's.
+.BR \-p , " \-\-pid " \fIpid\fR...
+Force the succeeding arguments to be interpreted as process IDs
+(the default).
 .TP
-\fB\-v\fR, \fB\-\-version\fR
-Print version.
+.BR \-h , " \-\-help"
+Display a help text.
 .TP
-\fB\-h\fR, \fB\-\-help\fR
-Print help.
+.BR \-V , " \-\-version"
+Display version information.
 .SH EXAMPLES
+The following command would change the priority of the processes with
+PIDs 987 and 32, plus all processes owned by the users daemon and root:
 .TP
-.B renice +1 987 -u daemon root -p 32
-would change the priority of process ID's 987 and 32, and all processes owned
-by users daemon and root.
+.B "       renice" +1 987 -u daemon root -p 32
 .SH NOTES
 Users other than the super-user may only alter the priority of processes they
 own, and can only monotonically increase their ``nice value'' (for security
@@ -105,7 +99,7 @@ negative (to make things go very fast).
 .SH FILES
 .TP
 .B /etc/passwd
-to map user names to user ID's
+to map user names to user IDs
 .SH SEE ALSO
 .BR getpriority (2),
 .BR setpriority (2)
index aeede181383b80ee04214f3f7f93ef2289283623..f4014359f7d53186dc1bf044fe7f70f4aac91179 100644 (file)
@@ -65,7 +65,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
                " -p, --pid <id>         interpret argument as process ID (default)\n"
                " -u, --user <name|id>   interpret argument as username or user ID\n"
                " -h, --help             display help text and exit\n"
-               " -v, --version          display version information and exit\n"), out);
+               " -V, --version          display version information and exit\n"), out);
 
        fputs(_("\nFor more information see renice(1).\n"), out);
 
@@ -73,9 +73,8 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
 }
 
 /*
- * Change the priority (nice) of processes
- * or groups of processes which are already
- * running.
+ * Change the priority (the nice value) of processes
+ * or groups of processes which are already running.
  */
 int
 main(int argc, char **argv)
@@ -98,8 +97,10 @@ main(int argc, char **argv)
                        usage(stdout);
 
                if (strcmp(*argv, "-v") == 0 ||
+                   strcmp(*argv, "-V") == 0 ||
                    strcmp(*argv, "--version") == 0) {
-                       printf(_("renice from %s\n"), PACKAGE_STRING);
+                       printf(_("%s from %s\n"),
+                              program_invocation_short_name, PACKAGE_STRING);
                        exit(EXIT_SUCCESS);
                }
        }