public enum XargsOption extends Enum<XargsOption> implements Option, XargsOptions
xargs command.
For most applications, it may be more convenient to use Xargs.Options
instead of the option constants defined here.
-z | --delimiter0 | Input items are terminated by a null character instead of by
whitespace, and the quotes and backslash are not special (every
character is taken literally). Disables the end of file string,
which is treated like any other argument. Useful when input items
might contain white space, quote marks, or backslashes. The find
--print0 option produces input suitable for this mode.
(This option is ignored if an explicit delimiter operand is specified). | |||
-x | --exactArgs | Terminate immediately if maxArgs is specified but the found
number of variable items is less than maxArgs.
(This option is ignored if no | |||
-r | --noRunIfEmpty | If the standard input does not contain any nonblanks, do not run the command. Normally, the command is run once even if there is no input. | |||
-t | --verbose | Print the command line on the standard error output before executing it. |
XargsOptions.Default| Enum Constant and Description |
|---|
delimiter0
Option
--delimiter0, -z:
Input items are terminated by a null character instead of by
whitespace, and the quotes and backslash are not special (every
character is taken literally). |
exactArgs
Option
--exactArgs, -x:
Terminate immediately if maxArgs is specified but the found
number of variable items is less than maxArgs. |
noRunIfEmpty
Option
--noRunIfEmpty, -r:
If the standard input does not contain any nonblanks, do not run the
command. |
verbose
Option
--verbose, -t:
Print the command line on the standard error output before executing
it. |
CONVERTER, EMPTY| Modifier and Type | Method and Description |
|---|---|
char |
acronym()
Returns a one letter acronym for this option.
|
EnumSet<XargsOption> |
asSet()
Returns a new set with
this active option. |
static XargsOption |
findByAcronym(char acronym)
Returns the option with the given
acronym, or null if no
such option is found. |
boolean |
isSet(XargsOption option)
Returns true if the specified
option is set and false otherwise |
Iterator<XargsOption> |
iterator()
Returns an immutable iterator returning o single element:
this
option. |
Class<XargsOption> |
optionType()
Returns the option type class, usually an enum.
|
int |
size()
Returns 1 as this is a set with a single element:
this option |
boolean |
useAcronymFor(XargsOption option)
Returns true if the
acronym should be used for
the specified option in string representations. |
static XargsOption |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static XargsOption[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfforEach, spliteratorpublic static final XargsOption delimiter0
--delimiter0, -z:
Input items are terminated by a null character instead of by
whitespace, and the quotes and backslash are not special (every
character is taken literally). Disables the end of file string,
which is treated like any other argument. Useful when input items
might contain white space, quote marks, or backslashes. The find
--print0 option produces input suitable for this mode.
(This option is ignored if an explicit delimiter operand is specified).
public static final XargsOption exactArgs
--exactArgs, -x:
Terminate immediately if maxArgs is specified but the found
number of variable items is less than maxArgs.
(This option is ignored if no maxArgs operand is specified).
public static final XargsOption noRunIfEmpty
--noRunIfEmpty, -r:
If the standard input does not contain any nonblanks, do not run the
command. Normally, the command is run once even if there is no
input.public static final XargsOption verbose
--verbose, -t:
Print the command line on the standard error output before executing
it.public static XargsOption[] values()
for (XargsOption c : XargsOption.values()) System.out.println(c);
public static XargsOption valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic Class<XargsOption> optionType()
OptionSetoptionType in interface OptionSet<XargsOption>public static XargsOption findByAcronym(char acronym)
acronym, or null if no
such option is found.acronym - the option acronymacronym or null if it
is not foundpublic char acronym()
Optionpublic boolean isSet(XargsOption option)
OptionSetoption is set and false otherwiseisSet in interface OptionSet<XargsOption>option - the option to testoption is set in this OptionSetpublic EnumSet<XargsOption> asSet()
this active option.asSet in interface OptionSet<XargsOption>public Iterator<XargsOption> iterator()
this
option.iterator in interface Iterable<XargsOption>iterator in interface OptionSet<XargsOption>this active option.public int size()
this optionsize in interface OptionSet<XargsOption>public boolean useAcronymFor(XargsOption option)
acronym should be used for
the specified option in string representations.
This method returns always true for all options.
useAcronymFor in interface OptionSet<XargsOption>option - the option of interestCopyright © 2025. All rights reserved.