Class PosixCommandGroup

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

public class PosixCommandGroup extends Object implements 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:

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()
      Description copied from interface: CommandGroup
      Returns the name of this command group.

      The default implementation returns the simple class name.

      Specified by:
      name in interface CommandGroup
      Returns:
      the group name
    • commands

      public Collection<Command> commands()
      Description copied from interface: CommandGroup
      Returns all commands in this group.
      Specified by:
      commands in interface CommandGroup
      Returns:
      the collection of commands, never null