Class Parser.Argument

java.lang.Object
software.amazon.smithy.cli.Parser.Argument
Enclosing class:
Parser

public static final class Parser.Argument extends Object
A command line argument.
  • Constructor Details

    • Argument

      public Argument(String longName, String shortName, Parser.Arity arity, String help)
      Parameters:
      longName - Long name of the argument (e.g., --help).
      shortName - Short name of the argument (e.g., -h).
      arity - Arity / number of times a value can be provided.
      help - Help text of the argument.
  • Method Details

    • getShortName

      public Optional<String> getShortName()
      Gets the short name of the argument (e.g., -h).
      Returns:
      Returns the optionally present short name.
    • getLongName

      public Optional<String> getLongName()
      Gets the long name of the argument (e.g., --help).
      Returns:
      Returns the optionally present long name.
    • getCanonicalName

      public String getCanonicalName()
      Gets the canonical name, which is the longName if present or the shortName.
      Returns:
      Returns the canonicalized argument name.
    • getArity

      public Parser.Arity getArity()
      Gets the arity (number of times an argument value can be provided).
      Returns:
      Returns the argument arity.
    • getHelp

      public String getHelp()
      Gets the argument help text.
      Returns:
      Returns the help text.