Class ArgumentDescription

java.lang.Object
org.jline.shell.ArgumentDescription

public class ArgumentDescription extends Object
Describes a command argument with a name and optional description.
Since:
4.0
See Also:
  • Constructor Details

    • ArgumentDescription

      public ArgumentDescription(String name)
      Creates a new argument description with the specified name and an empty description.
      Parameters:
      name - the argument name
      Throws:
      IllegalArgumentException - if the name contains spaces or tabs
    • ArgumentDescription

      public ArgumentDescription(String name, List<org.jline.utils.AttributedString> description)
      Creates a new argument description with the specified name and description.
      Parameters:
      name - the argument name
      description - the description lines
      Throws:
      IllegalArgumentException - if the name contains spaces or tabs
  • Method Details

    • name

      public String name()
      Returns the argument name.
      Returns:
      the name
    • description

      public List<org.jline.utils.AttributedString> description()
      Returns the argument description lines.
      Returns:
      the description, never null
    • of

      public static List<ArgumentDescription> of(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