Package org.apache.groovy.groovysh.jline
Class GroovyPosixCommands
java.lang.Object
org.apache.groovy.groovysh.jline.GroovyPosixCommands
Groovy-aware implementations of groovysh POSIX-style commands.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidWrites the supplied files, variables, or standard input to the current output stream.static voidSearches the selected inputs for lines matching the supplied pattern.static voidPrints the beginning of each requested input.static voidDisplays the requested inputs in the less viewer, or streams them when not interactive.static voidLists directory entries using the current groovysh working directory.static voidSorts the requested inputs and writes the ordered lines to the current output.static voidPrints the end of each requested input.static voidCounts lines, words, characters, or bytes for the selected inputs.
-
Constructor Details
-
GroovyPosixCommands
public GroovyPosixCommands()
-
-
Method Details
-
cat
public static void cat(org.jline.builtins.PosixCommands.Context context, Object[] argv) throws Exception Writes the supplied files, variables, or standard input to the current output stream.- Parameters:
context- command execution contextargv- command name and arguments- Throws:
Exception- if an input cannot be resolved or read
-
wc
public static void wc(org.jline.builtins.PosixCommands.Context context, Object[] argv) throws Exception Counts lines, words, characters, or bytes for the selected inputs.- Parameters:
context- command execution contextargv- command name and arguments- Throws:
Exception- if an input cannot be processed
-
head
public static void head(org.jline.builtins.PosixCommands.Context context, Object[] argv) throws Exception Prints the beginning of each requested input.- Parameters:
context- command execution contextargv- command name and arguments- Throws:
Exception- if an input cannot be read
-
tail
public static void tail(org.jline.builtins.PosixCommands.Context context, Object[] argv) throws Exception Prints the end of each requested input.- Parameters:
context- command execution contextargv- command name and arguments- Throws:
Exception- if an input cannot be read
-
ls
public static void ls(org.jline.builtins.PosixCommands.Context context, Object[] argv) throws Exception Lists directory entries using the current groovysh working directory.- Parameters:
context- command execution contextargv- command name and arguments- Throws:
Exception- if the listing cannot be produced
-
grep
public static void grep(org.jline.builtins.PosixCommands.Context context, Object[] argv) throws Exception Searches the selected inputs for lines matching the supplied pattern.- Parameters:
context- command execution contextargv- command name and arguments- Throws:
Exception- if the search cannot be completed
-
sort
public static void sort(org.jline.builtins.PosixCommands.Context context, Object[] argv) throws Exception Sorts the requested inputs and writes the ordered lines to the current output.- Parameters:
context- command execution contextargv- command name and arguments- Throws:
Exception- if an input cannot be read or sorted
-
less
public static void less(org.jline.builtins.PosixCommands.Context context, String[] argv) throws Exception Displays the requested inputs in the less viewer, or streams them when not interactive.- Parameters:
context- command execution contextargv- command name and arguments- Throws:
Exception- if the viewer cannot be initialized or an input cannot be opened
-