org.crsh.command
Class CRaSHCommand
java.lang.Object
groovy.lang.GroovyObjectSupport
org.crsh.command.GroovyCommand
org.crsh.command.CRaSHCommand
- All Implemented Interfaces:
- groovy.lang.GroovyObject, ShellCommand
- Direct Known Subclasses:
- JCRCommand
-
public abstract class CRaSHCommand
- extends GroovyCommand
-
- implements ShellCommand
-
Method Summary |
CompletionMatch |
complete(RuntimeContext context, String line)
Provide completions for the specified arguments. |
String |
describe(String line, DescriptionFormat mode)
Returns a description of the command or null if none can be found. |
void |
execute(String s)
|
CommandDescriptor<?> |
getDescriptor()
Returns the command descriptor. |
String |
getUnmatched()
|
protected String |
readLine(String msg)
|
protected String |
readLine(String msg, boolean echo)
|
CommandInvoker<?,?> |
resolveInvoker(InvocationMatch<CRaSHCommand> match)
|
CommandInvoker<?,?> |
resolveInvoker(String line)
Provides an invoker for the command line specified as a command line to parse. |
CommandInvoker<?,?> |
resolveInvoker(String name, Map<String,?> options, List<?> args)
Provides an invoker for the command line specified under the form of a command, options and arguments. |
(package private) static ScriptException |
toScript(Throwable cause)
|
Methods inherited from class groovy.lang.GroovyObjectSupport |
getMetaClass, setMetaClass |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private final Logger log
-
.
descriptor
private final CommandDescriptorImpl<?> descriptor
-
.
unmatched
protected String unmatched
-
The unmatched text, only valid during an invocation.
CRaSHCommand
protected CRaSHCommand()
throws IntrospectionException
-
- Throws:
IntrospectionException
getDescriptor
public CommandDescriptor<?> getDescriptor()
-
Returns the command descriptor.
-
-
- Returns:
- the command descriptor
readLine
protected final String readLine(String msg)
-
-
readLine
protected final String readLine(String msg,
boolean echo)
-
-
getUnmatched
public final String getUnmatched()
-
-
complete
public final CompletionMatch complete(RuntimeContext context,
String line)
- Description copied from interface:
ShellCommand
-
Provide completions for the specified arguments.
-
- Specified by:
complete
in interface ShellCommand
-
- Parameters:
context
- the command context
line
- the original command line arguments
- Returns:
- the completions
describe
public final String describe(String line,
DescriptionFormat mode)
- Description copied from interface:
ShellCommand
-
Returns a description of the command or null if none can be found.
-
- Specified by:
describe
in interface ShellCommand
-
- Parameters:
line
- the usage line
mode
- the description mode
- Returns:
- the description
toScript
static ScriptException toScript(Throwable cause)
-
-
resolveInvoker
public CommandInvoker<?,?> resolveInvoker(String name,
Map<String,?> options,
List<?> args)
- Description copied from interface:
ShellCommand
-
Provides an invoker for the command line specified under the form of a command, options and arguments.
-
- Specified by:
resolveInvoker
in interface ShellCommand
-
- Parameters:
name
- the command name, might be null
options
- the options
args
- the arguments
- Returns:
- the command
resolveInvoker
public CommandInvoker<?,?> resolveInvoker(String line)
- Description copied from interface:
ShellCommand
-
Provides an invoker for the command line specified as a command line to parse.
-
- Specified by:
resolveInvoker
in interface ShellCommand
-
- Parameters:
line
- the command line arguments
- Returns:
- the command
execute
public final void execute(String s)
throws ScriptException,
IOException
-
-
- Throws:
ScriptException
IOException
resolveInvoker
public final CommandInvoker<?,?> resolveInvoker(InvocationMatch<CRaSHCommand> match)
-
-
Copyright © 2014 eXo Platform SAS. All Rights Reserved.