Package org.jline.builtins
Class Completers.OptionCompleter
java.lang.Object
org.jline.builtins.Completers.OptionCompleter
- All Implemented Interfaces:
Completer
- Enclosing class:
Completers
-
Constructor Summary
ConstructorDescriptionOptionCompleter
(Collection<Completers.OptDesc> options, int startPos) OptionCompleter completes command options and parameters.OptionCompleter
(List<Completer> completers, Collection<Completers.OptDesc> options, int startPos) OptionCompleter completes command options and parameters.OptionCompleter
(List<Completer> completers, Function<String, Collection<Completers.OptDesc>> commandOptions, int startPos) OptionCompleter completes command options and parameters.OptionCompleter
(List<Completer> completers, Map<String, List<String>> optionValues, Collection<String> options, int startPos) OptionCompleter completes command options and parameters.OptionCompleter
(Map<String, List<String>> optionValues, Collection<String> options, int startPos) OptionCompleter completes command options and parameters.OptionCompleter
(Completer completer, Collection<Completers.OptDesc> options, int startPos) OptionCompleter completes command options and parameters.OptionCompleter
(Completer completer, Function<String, Collection<Completers.OptDesc>> commandOptions, int startPos) OptionCompleter completes command options and parameters.OptionCompleter
(Completer completer, Map<String, List<String>> optionValues, Collection<String> options, int startPos) OptionCompleter completes command options and parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
complete
(LineReader reader, ParsedLine commandLine, List<Candidate> candidates) Populates candidates with a list of possible completions for the command line.void
setStartPos
(int startPos)
-
Constructor Details
-
OptionCompleter
public OptionCompleter(Completer completer, Function<String, Collection<Completers.OptDesc>> commandOptions, int startPos) OptionCompleter completes command options and parameters. OptionCompleter should be used as an argument of ArgumentCompleter- Parameters:
completer
- command parameter completercommandOptions
- command options descriptionsstartPos
- OptionCompleter position in ArgumentCompleter parameters
-
OptionCompleter
public OptionCompleter(List<Completer> completers, Function<String, Collection<Completers.OptDesc>> commandOptions, int startPos) OptionCompleter completes command options and parameters. OptionCompleter should be used as an argument of ArgumentCompleter- Parameters:
completers
- command parameters completerscommandOptions
- command options descriptionsstartPos
- OptionCompleter position in ArgumentCompleter parameters
-
OptionCompleter
public OptionCompleter(List<Completer> completers, Map<String, List<String>> optionValues, Collection<String> options, int startPos) OptionCompleter completes command options and parameters. OptionCompleter should be used as an argument of ArgumentCompleter- Parameters:
completers
- command parameters completersoptionValues
- command value options as map key and its possible values as map valueoptions
- command options that do not have valuestartPos
- OptionCompleter position in ArgumentCompleter parameters
-
OptionCompleter
public OptionCompleter(Completer completer, Map<String, List<String>> optionValues, Collection<String> options, int startPos) OptionCompleter completes command options and parameters. OptionCompleter should be used as an argument of ArgumentCompleter- Parameters:
completer
- command parameter completeroptionValues
- command value options as map key and its possible values as map valueoptions
- command options that do not have valuestartPos
- OptionCompleter position in ArgumentCompleter parameters
-
OptionCompleter
public OptionCompleter(Map<String, List<String>> optionValues, Collection<String> options, int startPos) OptionCompleter completes command options and parameters. OptionCompleter should be used as an argument of ArgumentCompleter- Parameters:
optionValues
- command value options as map key and its possible values as map valueoptions
- command options that do not have valuestartPos
- OptionCompleter position in ArgumentCompleter parameters
-
OptionCompleter
OptionCompleter completes command options and parameters. OptionCompleter should be used as an argument of ArgumentCompleter- Parameters:
completer
- command parameter completeroptions
- command options that do not have valuestartPos
- OptionCompleter position in ArgumentCompleter parameters
-
OptionCompleter
public OptionCompleter(List<Completer> completers, Collection<Completers.OptDesc> options, int startPos) OptionCompleter completes command options and parameters. OptionCompleter should be used as an argument of ArgumentCompleter- Parameters:
completers
- command parameters completersoptions
- command options that do not have valuestartPos
- OptionCompleter position in ArgumentCompleter parameters
-
OptionCompleter
OptionCompleter completes command options and parameters. OptionCompleter should be used as an argument of ArgumentCompleter- Parameters:
options
- command options that do not have valuestartPos
- OptionCompleter position in ArgumentCompleter parameters
-
-
Method Details
-
setStartPos
public void setStartPos(int startPos) -
complete
Description copied from interface:Completer
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.
-