public final class GrepOptionSets extends Object
grep
command with the
the following options:
-i | --ignoreCase | Match lines ignoring the case when comparing the strings, also known from Unix with its acronym 'i'. | |||
-v | --invertMatch | Invert the match result, that is, a non-matching line is written to the output and a matching line is not. This option is also known from Unix with its acronym 'v'. | |||
-F | --fixedStrings | Use fixed-strings matching instead of regular expressions. This is
usually faster than the standard regexp version.
(This option is ignored if a | |||
-n | --lineNumber | Prefix each line of output with the line number within its input file. | |||
-c | --count | Suppress normal output; instead print a count of matching lines for
each input file. With the -v , --invertMatch option,
count non-matching lines. | |||
-l | --matchingFiles | Suppress normal output; instead print the name of each input file from which output would normally have been printed. The scanning will stop on the first match. | |||
-x | --wholeLine | Select only those matches that exactly match the whole line
excluding the terminating line ending.
(This option is ignored if a |
This class serves as entry point to every possible set of grep
options
defined as an enum constant. With this explicit expansion of all possible
option combinations, options can be passed to the command in a very compact
form, such as:
grep(Grep.Options.i, ...); grep(Grep.Options.i.v, ...); ... grep(Grep.Options.i.v.F.n.c.l.x, ...);
Modifier and Type | Field and Description |
---|---|
GrepOptionSet_Fcilnvx |
c
Option
"-c" : Suppress normal output; instead print a count of matching lines for
each input file. |
GrepOptionSet_Fcilnvx |
count
Option
"--count" : Suppress normal output; instead print a count of matching lines for
each input file. |
GrepOptionSet_Fcilnvx |
F
Option
"-F" : Use fixed-strings matching instead of regular expressions. |
GrepOptionSet_Fcilnvx |
fixedStrings
Option
"--fixedStrings" : Use fixed-strings matching instead of regular expressions. |
GrepOptionSet_Fcilnvx |
i
Option
"-i" : Match lines ignoring the case when comparing the strings, also known
from Unix with its acronym 'i'. |
GrepOptionSet_Fcilnvx |
ignoreCase
Option
"--ignoreCase" : Match lines ignoring the case when comparing the strings, also known
from Unix with its acronym 'i'. |
static GrepOptionSets |
INSTANCE
The singleton instance.
|
GrepOptionSet_Fcilnvx |
invertMatch
Option
"--invertMatch" : Invert the match result, that is, a non-matching line is written to
the output and a matching line is not. |
GrepOptionSet_Fcilnvx |
l
Option
"-l" : Suppress normal output; instead print the name of each input file
from which output would normally have been printed. |
GrepOptionSet_Fcilnvx |
lineNumber
Option
"--lineNumber" : Prefix each line of output with the line number within its input
file. |
GrepOptionSet_Fcilnvx |
matchingFiles
Option
"--matchingFiles" : Suppress normal output; instead print the name of each input file
from which output would normally have been printed. |
GrepOptionSet_Fcilnvx |
n
Option
"-n" : Prefix each line of output with the line number within its input
file. |
GrepOptionSet_Fcilnvx |
v
Option
"-v" : Invert the match result, that is, a non-matching line is written to
the output and a matching line is not. |
GrepOptionSet_Fcilnvx |
wholeLine
Option
"--wholeLine" : Select only those matches that exactly match the whole line
excluding the terminating line ending. |
GrepOptionSet_Fcilnvx |
x
Option
"-x" : Select only those matches that exactly match the whole line
excluding the terminating line ending. |
Constructor and Description |
---|
GrepOptionSets() |
public static final GrepOptionSets INSTANCE
public final GrepOptionSet_Fcilnvx c
"-c"
: Suppress normal output; instead print a count of matching lines for
each input file. With the -v
, --invertMatch
option,
count non-matching lines.
The option "-c"
is equivalent to the "--
count
"
option.
public final GrepOptionSet_Fcilnvx count
"--count"
: Suppress normal output; instead print a count of matching lines for
each input file. With the -v
, --invertMatch
option,
count non-matching lines.
The option "--count"
is equivalent to the "-
c
"
option.
public final GrepOptionSet_Fcilnvx F
"-F"
: Use fixed-strings matching instead of regular expressions. This is
usually faster than the standard regexp version.
(This option is ignored if a pattern
operand is specified
instead of the regexp
string).
The option "-F"
is equivalent to the "--
fixedStrings
"
option.
public final GrepOptionSet_Fcilnvx fixedStrings
"--fixedStrings"
: Use fixed-strings matching instead of regular expressions. This is
usually faster than the standard regexp version.
(This option is ignored if a pattern
operand is specified
instead of the regexp
string).
The option "--fixedStrings"
is equivalent to the "-
F
"
option.
public final GrepOptionSet_Fcilnvx i
"-i"
: Match lines ignoring the case when comparing the strings, also known
from Unix with its acronym 'i'.
The option "-i"
is equivalent to the "--
ignoreCase
"
option.
public final GrepOptionSet_Fcilnvx ignoreCase
"--ignoreCase"
: Match lines ignoring the case when comparing the strings, also known
from Unix with its acronym 'i'.
The option "--ignoreCase"
is equivalent to the "-
i
"
option.
public final GrepOptionSet_Fcilnvx v
"-v"
: Invert the match result, that is, a non-matching line is written to
the output and a matching line is not. This option is also known
from Unix with its acronym 'v'.
The option "-v"
is equivalent to the "--
invertMatch
"
option.
public final GrepOptionSet_Fcilnvx invertMatch
"--invertMatch"
: Invert the match result, that is, a non-matching line is written to
the output and a matching line is not. This option is also known
from Unix with its acronym 'v'.
The option "--invertMatch"
is equivalent to the "-
v
"
option.
public final GrepOptionSet_Fcilnvx n
"-n"
: Prefix each line of output with the line number within its input
file.
The option "-n"
is equivalent to the "--
lineNumber
"
option.
public final GrepOptionSet_Fcilnvx lineNumber
"--lineNumber"
: Prefix each line of output with the line number within its input
file.
The option "--lineNumber"
is equivalent to the "-
n
"
option.
public final GrepOptionSet_Fcilnvx l
"-l"
: Suppress normal output; instead print the name of each input file
from which output would normally have been printed. The scanning
will stop on the first match.
The option "-l"
is equivalent to the "--
matchingFiles
"
option.
public final GrepOptionSet_Fcilnvx matchingFiles
"--matchingFiles"
: Suppress normal output; instead print the name of each input file
from which output would normally have been printed. The scanning
will stop on the first match.
The option "--matchingFiles"
is equivalent to the "-
l
"
option.
public final GrepOptionSet_Fcilnvx x
"-x"
: Select only those matches that exactly match the whole line
excluding the terminating line ending.
(This option is ignored if a pattern
operand is specified
instead of the regexp
string).
The option "-x"
is equivalent to the "--
wholeLine
"
option.
public final GrepOptionSet_Fcilnvx wholeLine
"--wholeLine"
: Select only those matches that exactly match the whole line
excluding the terminating line ending.
(This option is ignored if a pattern
operand is specified
instead of the regexp
string).
The option "--wholeLine"
is equivalent to the "-
x
"
option.
public GrepOptionSets()
Copyright © 2024. All rights reserved.