Package picocli.shell.jline3
Class PicocliCommands
java.lang.Object
picocli.shell.jline3.PicocliCommands
- All Implemented Interfaces:
org.jline.console.CommandRegistry
Compiles SystemCompleter for command completion and implements a method commandDescription() that provides command descriptions
for JLine TailTipWidgets to be displayed in terminal status bar.
SystemCompleter implements the JLine 3
Completer
interface. SystemCompleter generates completion
candidates for the specified command line based on the CommandLine.Model.CommandSpec
that this PicocliCommands
was constructed with.- Since:
- 4.1.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Command that clears the screen.static class
Command factory that is necessary for applications that want the use theClearScreen
subcommand.Nested classes/interfaces inherited from interface org.jline.console.CommandRegistry
org.jline.console.CommandRegistry.CommandSession
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.jline.console.CmdDesc
commandDescription
(String command) org.jline.console.CmdDesc
commandDescription
(List<String> args) commandInfo
(String command) org.jline.reader.impl.completer.SystemCompleter
boolean
hasCommand
(String command) name()
Returns the name shown for this collection of picocli commands in the usage help message.void
Sets the name shown for this collection of picocli commands in the usage help message.
-
Constructor Details
-
PicocliCommands
public PicocliCommands(picocli.CommandLine cmd)
-
-
Method Details
-
hasCommand
- Specified by:
hasCommand
in interfaceorg.jline.console.CommandRegistry
- Parameters:
command
-- Returns:
- true if PicocliCommands contains command
-
compileCompleters
public org.jline.reader.impl.completer.SystemCompleter compileCompleters()- Specified by:
compileCompleters
in interfaceorg.jline.console.CommandRegistry
-
commandDescription
- Specified by:
commandDescription
in interfaceorg.jline.console.CommandRegistry
- Parameters:
args
-- Returns:
- command description for JLine TailTipWidgets to be displayed in terminal status bar.
-
commandInfo
- Specified by:
commandInfo
in interfaceorg.jline.console.CommandRegistry
-
invoke
public Object invoke(org.jline.console.CommandRegistry.CommandSession session, String command, Object... args) throws Exception - Specified by:
invoke
in interfaceorg.jline.console.CommandRegistry
- Throws:
Exception
-
execute
public Object execute(org.jline.console.CommandRegistry.CommandSession session, String command, String[] args) throws Exception - Throws:
Exception
-
commandNames
- Specified by:
commandNames
in interfaceorg.jline.console.CommandRegistry
-
commandAliases
- Specified by:
commandAliases
in interfaceorg.jline.console.CommandRegistry
-
commandDescription
-
name
Returns the name shown for this collection of picocli commands in the usage help message. If not set withname(String)
, this returnsCommandRegistry.name()
.- Specified by:
name
in interfaceorg.jline.console.CommandRegistry
- Returns:
- the name shown for this collection of picocli commands in the usage help message
-
name
Sets the name shown for this collection of picocli commands in the usage help message.- Parameters:
newName
- the new name to show
-