get rid of -f flag (and make it conform to posix)
This commit is contained in:
parent
10e3a8d21b
commit
fcdad54fc2
|
@ -41,7 +41,7 @@
|
|||
xargs \- construct argument list(s) and execute utility.
|
||||
.SH SYNOPSIS
|
||||
.ft B
|
||||
xargs [\-ft] [[\-x] \-n number] [\-s size] [utility [argument ...]]
|
||||
xargs [\-t] [[\-x] \-n number] [\-s size] [utility [argument ...]]
|
||||
.ft R
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
@ -70,21 +70,6 @@ Any single character, including newlines, may be escaped by a backslash.
|
|||
.PP
|
||||
The options are as follows:
|
||||
.TP
|
||||
\-f
|
||||
Force
|
||||
.I xargs
|
||||
to ignore the exit status returned by
|
||||
.IR utility .
|
||||
By default,
|
||||
.I xargs
|
||||
will exit immediately if
|
||||
.I utility
|
||||
exits with a non-zero exit status.
|
||||
This does not include ignoring
|
||||
.I utility
|
||||
exiting due to a signal or without calling
|
||||
.IR exit (2).
|
||||
.TP
|
||||
\-n number
|
||||
Set the maximum number of arguments taken from standard input for each
|
||||
invocation of the utility.
|
||||
|
|
|
@ -54,7 +54,7 @@ static char sccsid[] = "@(#)xargs.c 5.11 (Berkeley) 6/19/91";
|
|||
#include <limits.h>
|
||||
#include "pathnames.h"
|
||||
|
||||
int fflag, tflag;
|
||||
int tflag;
|
||||
void err __P((const char *, ...));
|
||||
void run(), usage();
|
||||
|
||||
|
@ -85,11 +85,8 @@ main(argc, argv)
|
|||
nargs = 5000;
|
||||
nline = ARG_MAX - 4 * 1024;
|
||||
nflag = xflag = 0;
|
||||
while ((ch = getopt(argc, argv, "fn:s:tx")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "n:s:tx")) != EOF)
|
||||
switch(ch) {
|
||||
case 'f':
|
||||
fflag = 1;
|
||||
break;
|
||||
case 'n':
|
||||
nflag = 1;
|
||||
if ((nargs = atoi(optarg)) <= 0)
|
||||
|
@ -288,15 +285,13 @@ run(argv)
|
|||
*/
|
||||
if (noinvoke || !WIFEXITED(status) || WIFSIGNALED(status))
|
||||
exit(127);
|
||||
if (!fflag && WEXITSTATUS(status))
|
||||
exit(WEXITSTATUS(status));
|
||||
}
|
||||
|
||||
void
|
||||
usage()
|
||||
{
|
||||
(void)fprintf(stderr,
|
||||
"usage: xargs [-ft] [[-x] -n number] [-s size] [utility [argument ...]]\n");
|
||||
"usage: xargs [-t] [[-x] -n number] [-s size] [utility [argument ...]]\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue