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 |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private boolean | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | ArgumentCompleter(final Collection<Completer>
The embedded completers completers)Create a new completer. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | complete(LineReader reader, ParsedLine line, final List<Candidate> candidates)
Implements jdk. Populates candidates with a list of possible completions for the command line. |
| public List | Returns: The list of completers.Returns the list of completers used inside this |
| public boolean | Returns: True if strict.Returns whether a completion at argument index N will success if all the completions from arguments 0-(N-1) also succeed. |
| public void | setStrict(final boolean
the strict flag strict)If true, a completion at argument index N will only succeed if all the completions from 0-(N-1) also succeed. |
| public void | setStrictCommand(final boolean
the strictCommand flag strictCommand)If true, a completion at argument index N will only succeed if all the completions from 1-(N-1) also succeed. |
| completers | back to summary |
|---|---|
| private final List<Completer> completers | |
| strict | back to summary |
|---|---|
| private boolean strict | |
| strictCommand | back to summary |
|---|---|
| private boolean strictCommand | |
| ArgumentCompleter | back to summary |
|---|---|
| public ArgumentCompleter(final Collection<Completer> completers) Create a new completer.
| |
| ArgumentCompleter | back to summary |
|---|---|
| public ArgumentCompleter(final Completer... completers) Create a new completer.
| |
| complete | back to summary |
|---|---|
| public void complete(LineReader reader, ParsedLine line, final List<Candidate> candidates) Implements jdk. Doc from jdk. Populates candidates with a list of possible completions for the command line. The list of candidates will be sorted and filtered by the LineReader, so that the list of candidates displayed to the user will usually be smaller than the list given by the completer. Thus it is not necessary for the completer to do any matching based on the current buffer. On the contrary, in order for the typo matcher to work, all possible candidates for the word being completed should be returned. | |
| getCompleters | back to summary |
|---|---|
| public List Returns the list of completers used inside this | |
| isStrict | back to summary |
|---|---|
| public boolean isStrict() Returns whether a completion at argument index N will success if all the completions from arguments 0-(N-1) also succeed.
| |
| setStrict | back to summary |
|---|---|
| public void setStrict(final boolean strict) If true, a completion at argument index N will only succeed if all the completions from 0-(N-1) also succeed.
| |
| setStrictCommand | back to summary |
|---|---|
| public void setStrictCommand(final boolean strictCommand) If true, a completion at argument index N will only succeed if all the completions from 1-(N-1) also succeed.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | cursor()
Implements jdk. The cursor position within the line. |
| public String | |
| public String | |
| public int | wordCursor()
Implements jdk. The cursor position within the current word. |
| public int | wordIndex()
Implements jdk. The index of the current word in the list of words. |
| public List |
| cursor | back to summary |
|---|---|
| private final int cursor | |
| word | back to summary |
|---|---|
| private final String word | |
| ArgumentLine | back to summary |
|---|---|
| public ArgumentLine(String word, int cursor) | |
| cursor | back to summary |
|---|---|
| public int cursor() Implements jdk. Doc from jdk. The cursor position within the line.
| |
| line | back to summary |
|---|---|
| public String line() Implements jdk. Doc from jdk. The unparsed line.
| |
| word | back to summary |
|---|---|
| public String word() Implements jdk. Doc from jdk. The current word being completed. If the cursor is after the last word, an empty string is returned.
| |
| wordCursor | back to summary |
|---|---|
| public int wordCursor() Implements jdk. Doc from jdk. The cursor position within the current word.
| |
| wordIndex | back to summary |
|---|---|
| public int wordIndex() Implements jdk. Doc from jdk. The index of the current word in the list of words.
| |
| words | back to summary |
|---|---|
| public List Implements jdk. Doc from jdk. The list of words.
| |