public class LastArgument extends Argument
A fragment implementation that picks-off the last argument on the line early.
For example, this would be a way to grab the destination directory of a UNIX
mv
command.
COMMAND_PREFIX
Constructor and Description |
---|
LastArgument(java.lang.String argName,
java.lang.String description,
boolean optional) |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.String> |
consume(java.util.List<java.lang.String> s)
Grab the pieces of the commandline relevant to this argument, configure the
implementation, and then return a new array of arguments that will have the
pieces of the original commandline that this command used removed.
|
getDescription, getUsage, getValue, isOptional, isSet, reset
public LastArgument(java.lang.String argName, java.lang.String description, boolean optional)
public java.util.List<java.lang.String> consume(java.util.List<java.lang.String> s) throws CommandlineSyntaxException
CommandlineFragment
Grab the pieces of the commandline relevant to this argument, configure the implementation, and then return a new array of arguments that will have the pieces of the original commandline that this command used removed.
consume
in interface CommandlineFragment
consume
in class Argument
s
- the list of argumentsCommandlineSyntaxException
- if the commandline is structurally invalid.