Class PosixCommandGroup

java.lang.Object
org.jline.builtins.PosixCommandGroup
All Implemented Interfaces:
org.jline.shell.CommandGroup

public class PosixCommandGroup extends Object implements org.jline.shell.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 ? uses CommandSession.setWorkingDirectory(Path) to update the session

Example:

 dispatcher.addGroup(new PosixCommandGroup());
 dispatcher.execute("echo hello");
 dispatcher.execute("ls -la");
 
Since:
4.0
  • Constructor Details

    • PosixCommandGroup

      public PosixCommandGroup()
      Creates a new PosixCommandGroup with all available POSIX commands.
  • Method Details

    • name

      public String name()
      Specified by:
      name in interface org.jline.shell.CommandGroup
    • commands

      public Collection<org.jline.shell.Command> commands()
      Specified by:
      commands in interface org.jline.shell.CommandGroup