net.dpml.cli.option
Class SourceDestArgument
- Argument, Option
An Argument implementation that allows a variable size Argument to precede a
fixed size argument. The canonical example of it's use is in the unix
cp
command where a number of source can be specified with
exactly one destination specfied at the end.
void | appendUsage(StringBuffer buffer, Set helpSettings, Comparator comp) - Appends usage information to the specified StringBuffer
|
boolean | canProcess(WriteableCommandLine commandLine, String arg) - Indicates whether this Option will be able to process the particular
argument.
|
List | helpLines(int depth, Set helpSettings, Comparator comp) - Builds up a list of HelpLineImpl instances to be presented by HelpFormatter.
|
void | validate(WriteableCommandLine commandLine, Option option) - Checks that the supplied CommandLine is valid with respect to the
suppled option.
|
appendUsage , canProcess , defaultValues , defaults , getConsumeRemaining , getDefaultValues , getDescription , getInitialSeparator , getMaximum , getMinimum , getPreferredName , getPrefixes , getSubsequentSeparator , getTriggers , getValidator , helpLines , isRequired , process , processValues , stripBoundaryQuotes , validate , validate |
SourceDestArgument
public SourceDestArgument(Argument source,
Argument dest)
Creates a SourceDestArgument using defaults where possible.
source
- the variable size Argumentdest
- the fixed size Argument
SourceDestArgument
public SourceDestArgument(Argument source,
Argument dest,
char initialSeparator,
char subsequentSeparator,
String consumeRemaining,
List defaultValues)
Creates a SourceDestArgument using the specified parameters.
source
- the variable size Argumentdest
- the fixed size ArgumentinitialSeparator
- the inistial separator to usesubsequentSeparator
- the subsequent separator to useconsumeRemaining
- the token triggering consume remaining behaviourdefaultValues
- the default values for the SourceDestArgument
appendUsage
public void appendUsage(StringBuffer buffer,
Set helpSettings,
Comparator comp)
Appends usage information to the specified StringBuffer
- appendUsage in interface Option
- appendUsage in interface ArgumentImpl
buffer
- the buffer to append tohelpSettings
- a set of display settings @see DisplaySettingcomp
- a comparator used to sort the Options
canProcess
public boolean canProcess(WriteableCommandLine commandLine,
String arg)
Indicates whether this Option will be able to process the particular
argument.
- canProcess in interface Option
- canProcess in interface ArgumentImpl
commandLine
- the CommandLine object to store defaults inarg
- the argument to be tested
- true if the argument can be processed by this Option
helpLines
public List helpLines(int depth,
Set helpSettings,
Comparator comp)
Builds up a list of HelpLineImpl instances to be presented by HelpFormatter.
- helpLines in interface Option
- helpLines in interface ArgumentImpl
depth
- the initial indent depthhelpSettings
- the HelpSettings that should be appliedcomp
- a comparator used to sort options when applicable.
- a List of HelpLineImpl objects