- java.lang.Object
-
- org.jline.shell.ArgumentDescription
-
public class ArgumentDescription extends java.lang.ObjectDescribes a command argument with a name and optional description.- Since:
- 4.0
- See Also:
CommandDescription
-
-
Constructor Summary
Constructors Constructor Description ArgumentDescription(java.lang.String name)Creates a new argument description with the specified name and an empty description.ArgumentDescription(java.lang.String name, java.util.List<org.jline.utils.AttributedString> description)Creates a new argument description with the specified name and description.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<org.jline.utils.AttributedString>description()Returns the argument description lines.java.lang.Stringname()Returns the argument name.static java.util.List<ArgumentDescription>of(java.lang.String... names)Creates a list of argument descriptions from names.
-
-
-
Constructor Detail
-
ArgumentDescription
public ArgumentDescription(java.lang.String name)
Creates a new argument description with the specified name and an empty description.- Parameters:
name- the argument name- Throws:
java.lang.IllegalArgumentException- if the name contains spaces or tabs
-
ArgumentDescription
public ArgumentDescription(java.lang.String name, java.util.List<org.jline.utils.AttributedString> description)Creates a new argument description with the specified name and description.- Parameters:
name- the argument namedescription- the description lines- Throws:
java.lang.IllegalArgumentException- if the name contains spaces or tabs
-
-
Method Detail
-
name
public java.lang.String name()
Returns the argument name.- Returns:
- the name
-
description
public java.util.List<org.jline.utils.AttributedString> description()
Returns the argument description lines.- Returns:
- the description, never null
-
of
public static java.util.List<ArgumentDescription> of(java.lang.String... names)
Creates a list of argument descriptions from names. Each description will have an empty description list.- Parameters:
names- the argument names- Returns:
- a list of argument descriptions
-
-