public class Builtins extends Object implements CommandRegistry
| Modifier and Type | Class and Description |
|---|---|
static class |
Builtins.Command |
static class |
Builtins.CommandInput |
static class |
Builtins.CommandMethods |
| Constructor and Description |
|---|
Builtins(Path workDir,
ConfigurationPath configPath,
Function<String,Widget> widgetCreator) |
Builtins(Set<Builtins.Command> commands,
Path workDir,
ConfigurationPath configpath,
Function<String,Widget> widgetCreator) |
Builtins(Set<Builtins.Command> commands,
Supplier<Path> workDir,
ConfigurationPath configpath,
Function<String,Widget> widgetCreator) |
Builtins(Supplier<Path> workDir,
ConfigurationPath configPath,
Function<String,Widget> widgetCreator) |
| Modifier and Type | Method and Description |
|---|---|
void |
alias(String alias,
String command) |
Map<String,String> |
commandAliases()
Returns a map of alias-to-command names known by this registry.
|
Widgets.CmdDesc |
commandDescription(String command)
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.
|
Completers.SystemCompleter |
compileCompleters()
Returns a
SystemCompleter that can provide detailed completion
information for all registered commands. |
void |
execute(String command,
List<String> args,
InputStream in,
PrintStream out,
PrintStream err) |
void |
execute(String command,
String[] args,
InputStream in,
PrintStream out,
PrintStream err) |
boolean |
hasCommand(String name)
Returns whether a command with the specified name is known to this registry.
|
void |
rename(Builtins.Command command,
String newName) |
void |
setLineReader(LineReader reader) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaggregateCompleters, compileCompleterspublic Builtins(Path workDir, ConfigurationPath configPath, Function<String,Widget> widgetCreator)
public Builtins(Set<Builtins.Command> commands, Path workDir, ConfigurationPath configpath, Function<String,Widget> widgetCreator)
public Builtins(Supplier<Path> workDir, ConfigurationPath configPath, Function<String,Widget> widgetCreator)
public Builtins(Set<Builtins.Command> commands, Supplier<Path> workDir, ConfigurationPath configpath, Function<String,Widget> widgetCreator)
public Set<String> commandNames()
CommandRegistrycommandNames in interface CommandRegistrypublic Map<String,String> commandAliases()
CommandRegistrycommandAliases in interface CommandRegistrypublic List<String> commandInfo(String command)
CommandRegistrycommandInfo in interface CommandRegistrypublic void setLineReader(LineReader reader)
public void rename(Builtins.Command command, String newName)
public boolean hasCommand(String name)
CommandRegistryhasCommand in interface CommandRegistryname - the command name to testpublic Completers.SystemCompleter compileCompleters()
CommandRegistrySystemCompleter that can provide detailed completion
information for all registered commands.compileCompleters in interface CommandRegistrypublic void execute(String command, List<String> args, InputStream in, PrintStream out, PrintStream err) throws Exception
Exceptionpublic void execute(String command, String[] args, InputStream in, PrintStream out, PrintStream err) throws Exception
Exceptionpublic Widgets.CmdDesc commandDescription(String command)
CommandRegistrycommandDescription in interface CommandRegistrycommand - name of the command whose description to returnCopyright © 2020. All rights reserved.