public class ArgumentCompleter extends Object implements Completer
Completer
implementation that invokes a child completer using the appropriate separator argument.
This can be used instead of the individual completers having to know about argument parsing semantics.Modifier and Type | Class and Description |
---|---|
static class |
ArgumentCompleter.ArgumentLine |
Constructor and Description |
---|
ArgumentCompleter(Collection<Completer> completers)
Create a new completer.
|
ArgumentCompleter(Completer... completers)
Create a new completer.
|
Modifier and Type | Method and Description |
---|---|
void |
complete(LineReader reader,
ParsedLine line,
List<Candidate> candidates)
Populates candidates with a list of possible completions for the command line.
|
List<Completer> |
getCompleters()
Returns the list of completers used inside this
ArgumentCompleter . |
boolean |
isStrict()
Returns whether a completion at argument index N will success
if all the completions from arguments 0-(N-1) also succeed.
|
void |
setStrict(boolean strict)
If true, a completion at argument index N will only succeed
if all the completions from 0-(N-1) also succeed.
|
void |
setStrictCommand(boolean strictCommand)
If true, a completion at argument index N will only succeed
if all the completions from 1-(N-1) also succeed.
|
public ArgumentCompleter(Collection<Completer> completers)
completers
- The embedded completerspublic ArgumentCompleter(Completer... completers)
completers
- The embedded completerspublic void setStrict(boolean strict)
strict
- the strict flagpublic void setStrictCommand(boolean strictCommand)
strictCommand
- the strictCommand flagpublic boolean isStrict()
public List<Completer> getCompleters()
ArgumentCompleter
.public void complete(LineReader reader, ParsedLine line, List<Candidate> candidates)
Completer