Package org.jline.console
Class CmdLine
java.lang.Object
org.jline.console.CmdLine
Represents a command line with its parsed components.
This class stores information about a command line, including the original line,
the part before and after the cursor, the parsed arguments, and the type of
description that should be displayed for the command.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration specifying the type of description that should be displayed for the command. -
Field Summary
FieldsModifier and TypeFieldDescriptionThe parsed command line argumentsprivate final CmdLine.DescriptionTypeThe type of description that should be displayed for the commandprivate final StringThe part of the command line before the cursor, with method parameters and opening parenthesis removedprivate final StringThe original command lineprivate final StringThe part of the command line after the cursor, with method parameters and closing parenthesis removed -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetArgs()Returns the parsed command line arguments.Returns the type of description that should be displayed for the command.getHead()Returns the part of the command line before the cursor, with method parameters and opening parenthesis removed.getLine()Returns the original command line.getTail()Returns the part of the command line after the cursor, with method parameters and closing parenthesis removed.
-
Field Details
-
line
The original command line -
head
The part of the command line before the cursor, with method parameters and opening parenthesis removed -
tail
The part of the command line after the cursor, with method parameters and closing parenthesis removed -
args
The parsed command line arguments -
descType
The type of description that should be displayed for the command
-
-
Constructor Details
-
CmdLine
public CmdLine(String line, String head, String tail, List<String> args, CmdLine.DescriptionType descType) Creates a new command line with the specified components.- Parameters:
line- The original command linehead- The part of the command line before the cursor, with method parameters and opening parenthesis removedtail- The part of the command line after the cursor, with method parameters and closing parenthesis removedargs- The parsed command line argumentsdescType- The type of description that should be displayed for the command
-
-
Method Details
-
getLine
Returns the original command line.- Returns:
- the original command line
-
getHead
Returns the part of the command line before the cursor, with method parameters and opening parenthesis removed.- Returns:
- the part of the command line before the cursor
-
getTail
Returns the part of the command line after the cursor, with method parameters and closing parenthesis removed.- Returns:
- the part of the command line after the cursor
-
getArgs
Returns the parsed command line arguments.- Returns:
- the parsed command line arguments
-
getDescriptionType
Returns the type of description that should be displayed for the command.- Returns:
- the type of description
-