- java.lang.Object
-
- org.jline.shell.CommandLine
-
public class CommandLine extends java.lang.ObjectRepresents a parsed command line with its components.- Since:
- 4.0
- See Also:
CommandDescription,CommandDispatcher.describe(CommandLine)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCommandLine.TypeThe type of description that should be displayed.
-
Constructor Summary
Constructors Constructor Description CommandLine(java.lang.String line, java.lang.String head, java.lang.String tail, java.util.List<java.lang.String> args, CommandLine.Type type)Creates a new command line.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>args()Returns the parsed arguments.java.lang.Stringhead()Returns the part before the cursor.java.lang.Stringline()Returns the original command line.java.lang.Stringtail()Returns the part after the cursor.CommandLine.Typetype()Returns the description type.
-
-
-
Constructor Detail
-
CommandLine
public CommandLine(java.lang.String line, java.lang.String head, java.lang.String tail, java.util.List<java.lang.String> args, CommandLine.Type type)Creates a new command line.- Parameters:
line- the original command linehead- the part before the cursortail- the part after the cursorargs- the parsed argumentstype- the description type
-
-
Method Detail
-
line
public java.lang.String line()
Returns the original command line.- Returns:
- the line
-
head
public java.lang.String head()
Returns the part before the cursor.- Returns:
- the head
-
tail
public java.lang.String tail()
Returns the part after the cursor.- Returns:
- the tail
-
args
public java.util.List<java.lang.String> args()
Returns the parsed arguments.- Returns:
- the arguments
-
type
public CommandLine.Type type()
Returns the description type.- Returns:
- the type
-
-