Package software.amazon.smithy.cli
Class Parser.Argument
java.lang.Object
software.amazon.smithy.cli.Parser.Argument
- Enclosing class:
- Parser
A command line argument.
-
Constructor Summary
ConstructorsConstructorDescriptionArgument
(String longName, String shortName, Parser.Arity arity, String help) -
Method Summary
Modifier and TypeMethodDescriptiongetArity()
Gets the arity (number of times an argument value can be provided).Gets the canonical name, which is the longName if present or the shortName.getHelp()
Gets the argument help text.Gets the long name of the argument (e.g., --help).Gets the short name of the argument (e.g., -h).
-
Constructor Details
-
Argument
- 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
Gets the short name of the argument (e.g., -h).- Returns:
- Returns the optionally present short name.
-
getLongName
Gets the long name of the argument (e.g., --help).- Returns:
- Returns the optionally present long name.
-
getCanonicalName
Gets the canonical name, which is the longName if present or the shortName.- Returns:
- Returns the canonicalized argument name.
-
getArity
Gets the arity (number of times an argument value can be provided).- Returns:
- Returns the argument arity.
-
getHelp
Gets the argument help text.- Returns:
- Returns the help text.
-