public interface CommandRegistry
| Modifier and Type | Interface and Description |
|---|---|
static class |
CommandRegistry.CommandSession |
| Modifier and Type | Method and Description |
|---|---|
static org.jline.reader.impl.completer.SystemCompleter |
aggregateCompleters(CommandRegistry... commandRegistries)
Aggregate SystemCompleters of commandRegisteries
|
Map<String,String> |
commandAliases()
Returns a map of alias-to-command names known by this registry.
|
CmdDesc |
commandDescription(List<String> args)
Returns a command description for use in the JLine Widgets framework.
|
List<String> |
commandInfo(String command)
Returns a short info about command known by this registry.
|
Set<String> |
commandNames()
Returns the command names known by this registry.
|
org.jline.reader.impl.completer.SystemCompleter |
compileCompleters()
Returns a
SystemCompleter that can provide detailed completion
information for all registered commands. |
static org.jline.reader.impl.completer.SystemCompleter |
compileCompleters(CommandRegistry... commandRegistries)
Aggregate and compile SystemCompleters of commandRegisteries
|
boolean |
hasCommand(String command)
Returns whether a command with the specified name is known to this registry.
|
default Object |
invoke(CommandRegistry.CommandSession session,
String command,
Object... args)
Execute a command.
|
default String |
name()
Returns the name of this registry.
|
static org.jline.reader.impl.completer.SystemCompleter aggregateCompleters(CommandRegistry... commandRegistries)
commandRegistries - command registeries which completers is to be aggregatedstatic org.jline.reader.impl.completer.SystemCompleter compileCompleters(CommandRegistry... commandRegistries)
commandRegistries - command registeries which completers is to be aggregated and compiledefault String name()
Set<String> commandNames()
Map<String,String> commandAliases()
List<String> commandInfo(String command)
command - the command nameboolean hasCommand(String command)
command - the command name to testorg.jline.reader.impl.completer.SystemCompleter compileCompleters()
SystemCompleter that can provide detailed completion
information for all registered commands.CmdDesc commandDescription(List<String> args)
args - command (args[0]) and its argumentsdefault Object invoke(CommandRegistry.CommandSession session, String command, Object... args) throws Exception
session - the data of the current command sessioncommand - the name of the commandargs - arguments of the commandException - in case of errorCopyright © 2020. All rights reserved.