Package org.jline.builtins
Class PosixCommandGroup
java.lang.Object
org.jline.builtins.PosixCommandGroup
- All Implemented Interfaces:
CommandGroup
A
CommandGroup that wraps PosixCommands static methods as shell Commands.
This provides a bridge between the builtins module's POSIX command implementations
and the shell module's command API. Each command creates a PosixCommands.Context
from the current CommandSession.
Special handling:
cd— usesCommandSession.setWorkingDirectory(Path)to update the session
Example:
dispatcher.addGroup(new PosixCommandGroup());
dispatcher.execute("echo hello");
dispatcher.execute("ls -la");
- Since:
- 4.0
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new PosixCommandGroup with all available POSIX commands. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jline.shell.CommandGroup
command, hasCommand
-
Constructor Details
-
PosixCommandGroup
public PosixCommandGroup()Creates a new PosixCommandGroup with all available POSIX commands.
-
-
Method Details
-
name
Description copied from interface:CommandGroupReturns the name of this command group.The default implementation returns the simple class name.
- Specified by:
namein interfaceCommandGroup- Returns:
- the group name
-
commands
Description copied from interface:CommandGroupReturns all commands in this group.- Specified by:
commandsin interfaceCommandGroup- Returns:
- the collection of commands, never null
-