public abstract class ShellCommand<T> extends Object
| Constructor and Description |
|---|
ShellCommand() |
| Modifier and Type | Method and Description |
|---|---|
CompletionMatch |
complete(RuntimeContext context,
String line)
Provide completions for the specified arguments.
|
String |
describe(InvocationMatch<T> match,
Format format) |
String |
describe(String line,
Format format)
Returns a description of the command or null if none can be found.
|
protected abstract Completer |
getCompleter(RuntimeContext context)
Returns a completer for this command.
|
abstract CommandDescriptor<T> |
getDescriptor()
Returns the command descriptor.
|
protected abstract Command<?,?> |
resolveCommand(InvocationMatch<T> match)
Resolve the real command for a specified invocation match.
|
Command<?,?> |
resolveCommand(String line) |
CommandInvoker<?,?> |
resolveInvoker(Map<String,?> options,
String subordinate,
Map<String,?> subordinateOptions,
List<?> arguments)
Provides an invoker for the command line specified in a detyped manner.
|
CommandInvoker<?,?> |
resolveInvoker(String line)
Provides an invoker for the command line specified as a command line to parse.
|
public ShellCommand()
public abstract CommandDescriptor<T> getDescriptor()
protected abstract Completer getCompleter(RuntimeContext context) throws CommandCreationException
context - the related runtime contextCommandCreationException - anything that would prevent completion to happenprotected abstract Command<?,?> resolveCommand(InvocationMatch<T> match)
match - the matchpublic final String describe(InvocationMatch<T> match, Format format)
public final CompletionMatch complete(RuntimeContext context, String line) throws CommandCreationException
context - the command contextline - the original command line argumentsCommandCreationExceptionpublic final String describe(String line, Format format)
line - the usage lineformat - the description formatpublic final CommandInvoker<?,?> resolveInvoker(String line) throws CommandCreationException
line - the command line argumentsCommandCreationExceptionpublic final Command<?,?> resolveCommand(String line) throws CommandCreationException
CommandCreationExceptionpublic final CommandInvoker<?,?> resolveInvoker(Map<String,?> options, String subordinate, Map<String,?> subordinateOptions, List<?> arguments) throws CommandCreationException
options - the base optionssubordinate - the subordinate command name, might nullsubordinateOptions - the subordinate optionsarguments - argumentsCommandCreationExceptionCopyright © 2014 eXo Platform SAS. All Rights Reserved.