Class CommandLine

java.lang.Object
org.jline.shell.CommandLine

public class CommandLine extends Object
Represents a parsed command line with its components.
Since:
4.0
See Also:
  • Constructor Details

    • CommandLine

      public CommandLine(String line, String head, String tail, List<String> args, CommandLine.Type type)
      Creates a new command line.
      Parameters:
      line - the original command line
      head - the part before the cursor
      tail - the part after the cursor
      args - the parsed arguments
      type - the description type
  • Method Details

    • line

      public String line()
      Returns the original command line.
      Returns:
      the line
    • head

      public String head()
      Returns the part before the cursor.
      Returns:
      the head
    • tail

      public String tail()
      Returns the part after the cursor.
      Returns:
      the tail
    • args

      public List<String> args()
      Returns the parsed arguments.
      Returns:
      the arguments
    • type

      public CommandLine.Type type()
      Returns the description type.
      Returns:
      the type