Class ArgDesc

java.lang.Object
org.jline.console.ArgDesc

public class ArgDesc extends Object
Represents a command argument description used for generating command help and documentation. This class stores the name of an argument and its description as a list of attributed strings, which can include formatting and styling.
  • Constructor Details

    • ArgDesc

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

      public ArgDesc(String name, List<AttributedString> description)
      Creates a new argument description with the specified name and description.
      Parameters:
      name - the name of the argument
      description - the description of the argument as a list of attributed strings
      Throws:
      IllegalArgumentException - if the name contains spaces or tabs
  • Method Details

    • getName

      public String getName()
      Returns the name of the argument.
      Returns:
      the argument name
    • getDescription

      public List<AttributedString> getDescription()
      Returns the description of the argument as a list of attributed strings.
      Returns:
      the argument description
    • doArgNames

      public static List<ArgDesc> doArgNames(List<String> names)
      Creates a list of argument descriptions from a list of argument names. Each argument description will have an empty description.
      Parameters:
      names - the list of argument names
      Returns:
      a list of argument descriptions