Class PosixCommandGroup

  • All Implemented Interfaces:
    org.jline.shell.CommandGroup

    public class PosixCommandGroup
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      PosixCommandGroup()
      Creates a new PosixCommandGroup with all available POSIX commands.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Collection<org.jline.shell.Command> commands()  
      java.lang.String name()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.jline.shell.CommandGroup

        command, hasCommand
    • Constructor Detail

      • PosixCommandGroup

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

      • name

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

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