| Modifier and Type | Class and Description |
|---|---|
| private static class | AutoComplete.App
CLI command class for generating completion script. |
| private static class | AutoComplete.Bashify
Drops all characters that are not valid for bash function and identifier names. |
| private static class | |
| private static class | |
| private static interface | |
| public static class | AutoComplete.GenerateCompletion
Command that generates a Bash/ZSH completion script for its top-level command. |
| private static class | |
| private static interface |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | EXIT_CODE_COMMAND_SCRIPT_EXISTS
Exit code of this application when the specified command script exists (2). |
| public static final int | EXIT_CODE_COMPLETION_SCRIPT_EXISTS
Exit code of this application when the specified completion script exists (3). |
| public static final int | EXIT_CODE_EXECUTION_ERROR
Exit code of this application when an exception was encountered during operation (4). |
| public static final int | EXIT_CODE_INVALID_INPUT
Exit code of this application when the specified command line arguments are invalid (1). |
| public static final int | EXIT_CODE_SUCCESS
Normal exit code of this application (0). |
| private static final String | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| private static void | addCandidatesForArgsFollowing(CommandLine.
|
| private static void | addCandidatesForArgsFollowing(CommandLine.
|
| private static void | addCandidatesForArgsFollowing(CommandLine.
|
| private static void | |
| public static void | bash(String
the name of the command to generate a bash autocompletion script for scriptName, File the file to write the autocompletion bash script source code to out, File the file to write a helper script to that invokes the command, or command, CommandLine null if no helper script file should be writtenthe commandLine)CommandLine instance for the command line applicationGenerates source code for an autocompletion bash script for the specified picocli-based application,
and writes this script to the specified |
| public static String | Returns: source code for an autocompletion bash scriptthe name of the command to generate a bash autocompletion script for scriptName, CommandLine the commandLine)CommandLine instance for the command line applicationGenerates and returns the source code for an autocompletion bash script for the specified picocli-based application. |
| private static String | |
| public static int | complete(CommandLine.
|
| private static String | |
| private static String | |
| private static <V, T extends V> String | |
| private static List | |
| private static void | createSubHierarchy(String scriptName, String parentWithoutTopLevelCommand, CommandLine commandLine, List<AutoComplete.
|
| private static boolean | |
| private static boolean | |
| private static List | |
| private static <K, T extends K> List | |
| private static void | |
| private static CommandLine. | |
| private static CommandLine. | |
| private static CommandLine. | findCommandFor(CommandLine.
|
| private static Object | |
| private static void | |
| private static void | |
| private static String | generateEntryPointFunction(String scriptName, CommandLine commandLine, List<AutoComplete.
|
| private static void | generateFunctionCallsToArrContains(StringBuilder buff, List<AutoComplete.
|
| private static String | |
| private static String | generateOptionsCases(List<CommandLine.
|
| private static String | |
| private static String | generatePositionalParamsCases(List<CommandLine.
|
| private static void | |
| private static boolean | |
| public static void | main(String...
command line options. Specify at least the args)commandLineFQCN mandatory parameter, which is
the fully qualified class name of the annotated @Command class to generate a completion script for.
Other parameters are optional. Specify -h to see details on the available options.Generates a bash completion script for the specified command class. |
| private static <T> AutoComplete. | |
| private static String | |
| private static String | |
| private static boolean |
| EXIT_CODE_COMMAND_SCRIPT_EXISTS | back to summary |
|---|---|
| public static final int EXIT_CODE_COMMAND_SCRIPT_EXISTS Exit code of this application when the specified command script exists (2). | |
| EXIT_CODE_COMPLETION_SCRIPT_EXISTS | back to summary |
|---|---|
| public static final int EXIT_CODE_COMPLETION_SCRIPT_EXISTS Exit code of this application when the specified completion script exists (3). | |
| EXIT_CODE_EXECUTION_ERROR | back to summary |
|---|---|
| public static final int EXIT_CODE_EXECUTION_ERROR Exit code of this application when an exception was encountered during operation (4). | |
| EXIT_CODE_INVALID_INPUT | back to summary |
|---|---|
| public static final int EXIT_CODE_INVALID_INPUT Exit code of this application when the specified command line arguments are invalid (1). | |
| EXIT_CODE_SUCCESS | back to summary |
|---|---|
| public static final int EXIT_CODE_SUCCESS Normal exit code of this application (0). | |
| SCRIPT_FOOTER | back to summary |
|---|---|
| private static final String SCRIPT_FOOTER | |
| SCRIPT_HEADER | back to summary |
|---|---|
| private static final String SCRIPT_HEADER | |
| AutoComplete | back to summary |
|---|---|
| private AutoComplete() | |
| addCandidatesForArgsFollowing | back to summary |
|---|---|
| private static void addCandidatesForArgsFollowing(Object obj, List<CharSequence> candidates) | |
| addCandidatesForArgsFollowing | back to summary |
|---|---|
| private static void addCandidatesForArgsFollowing(CommandLine. | |
| addCandidatesForArgsFollowing | back to summary |
|---|---|
| private static void addCandidatesForArgsFollowing(CommandLine. | |
| addCandidatesForArgsFollowing | back to summary |
|---|---|
| private static void addCandidatesForArgsFollowing(CommandLine. | |
| addCompletionCandidates | back to summary |
|---|---|
| private static void addCompletionCandidates(Iterable<String> completionCandidates, List<CharSequence> candidates) | |
| bash | back to summary |
|---|---|
| public static void bash(String scriptName, File out, File command, CommandLine commandLine) throws IOException Generates source code for an autocompletion bash script for the specified picocli-based application,
and writes this script to the specified
| |
| bash | back to summary |
|---|---|
| public static String bash(String scriptName, CommandLine commandLine) Generates and returns the source code for an autocompletion bash script for the specified picocli-based application.
| |
| bashify | back to summary |
|---|---|
| private static String bashify(CharSequence value) | |
| complete | back to summary |
|---|---|
| public static int complete(CommandLine. | |
| concat | back to summary |
|---|---|
| private static String concat(String infix, String... values) | |
| concat | back to summary |
|---|---|
| private static String concat(String infix, List<String> values) | |
| concat | back to summary |
|---|---|
| private static <V, T extends V> String concat(String infix, List<T> values, T lastValue, AutoComplete. | |
| createHierarchy | back to summary |
|---|---|
| private static List | |
| createSubHierarchy | back to summary |
|---|---|
| private static void createSubHierarchy(String scriptName, String parentWithoutTopLevelCommand, CommandLine commandLine, List<AutoComplete. | |
| exitOnError | back to summary |
|---|---|
| private static boolean exitOnError() | |
| exitOnSuccess | back to summary |
|---|---|
| private static boolean exitOnSuccess() | |
| extract | back to summary |
|---|---|
| private static List | |
| filter | back to summary |
|---|---|
| private static <K, T extends K> List | |
| filterAndTrimMatchingPrefix | back to summary |
|---|---|
| private static void filterAndTrimMatchingPrefix(String prefix, List<CharSequence> candidates) | |
| findCommandFor | back to summary |
|---|---|
| private static CommandLine. | |
| findCommandFor | back to summary |
|---|---|
| private static CommandLine. | |
| findCommandFor | back to summary |
|---|---|
| private static CommandLine. | |
| findCompletionStartPoint | back to summary |
|---|---|
| private static Object findCompletionStartPoint(CommandLine. | |
| generateCompletionCandidates | back to summary |
|---|---|
| private static void generateCompletionCandidates(StringBuilder buff, CommandLine. | |
| generatedEdgeCaseFunctionCalls | back to summary |
|---|---|
| private static void generatedEdgeCaseFunctionCalls(StringBuilder buff, List<AutoComplete. | |
| generateEntryPointFunction | back to summary |
|---|---|
| private static String generateEntryPointFunction(String scriptName, CommandLine commandLine, List<AutoComplete. | |
| generateFunctionCallsToArrContains | back to summary |
|---|---|
| private static void generateFunctionCallsToArrContains(StringBuilder buff, List<AutoComplete. | |
| generateFunctionForCommand | back to summary |
|---|---|
| private static String generateFunctionForCommand(String functionName, String commandName, CommandLine commandLine) | |
| generateOptionsCases | back to summary |
|---|---|
| private static String generateOptionsCases(List<CommandLine. | |
| generateOptionsSwitch | back to summary |
|---|---|
| private static String generateOptionsSwitch(List<CommandLine. | |
| generatePositionalParamsCases | back to summary |
|---|---|
| private static String generatePositionalParamsCases(List<CommandLine. | |
| generatePositionParamCompletionCandidates | back to summary |
|---|---|
| private static void generatePositionParamCompletionCandidates(StringBuilder buff, CommandLine. | |
| isPicocliModelObject | back to summary |
|---|---|
| private static boolean isPicocliModelObject(Object obj) | |
| main | back to summary |
|---|---|
| public static void main(String... args) Generates a bash completion script for the specified command class.
| |
| negate | back to summary |
|---|---|
| private static <T> AutoComplete. | |
| optionNames | back to summary |
|---|---|
| private static String optionNames(List<CommandLine. | |
| sanitizeScriptName | back to summary |
|---|---|
| private static String sanitizeScriptName(String scriptName) | |
| syspropDefinedAndNotFalse | back to summary |
|---|---|
| private static boolean syspropDefinedAndNotFalse(String key) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv File | |
| pack-priv String | |
| pack-priv String | |
| pack-priv String | |
| pack-priv boolean | |
| pack-priv CommandLine. | |
| pack-priv boolean |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Integer | call()
Implements java. |
| private boolean |
| autoCompleteScript | back to summary |
|---|---|
pack-priv File autoCompleteScript
| |
| commandLineFQCN | back to summary |
|---|---|
pack-priv String commandLineFQCN
| |
| commandName | back to summary |
|---|---|
pack-priv String commandName
| |
| factoryClass | back to summary |
|---|---|
pack-priv String factoryClass
| |
| overwriteIfExists | back to summary |
|---|---|
pack-priv boolean overwriteIfExists
| |
| spec | back to summary |
|---|---|
| pack-priv CommandLine. | |
| writeCommandScript | back to summary |
|---|---|
pack-priv boolean writeCommandScript
| |
| App | back to summary |
|---|---|
| private App() | |
| call | back to summary |
|---|---|
| public Integer call() throws Exception Implements java. Doc from java. Computes a result, or throws an exception if unable to do so. | |
| checkExists | back to summary |
|---|---|
| private boolean checkExists(final File file) | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public String |
| Bashify | back to summary |
|---|---|
| private Bashify() | |
| apply | back to summary |
|---|---|
| public String apply(CharSequence value) Implements picocli. | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean |
| BooleanArgFilter | back to summary |
|---|---|
| private BooleanArgFilter() | |
| test | back to summary |
|---|---|
| public boolean test(CommandLine. Implements picocli. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final CommandLine | |
| pack-priv final String | |
| pack-priv final String | |
| pack-priv final String | |
| pack-priv final String |
| Access | Constructor and Description |
|---|---|
| pack-priv | CommandDescriptor(String functionName, String parentFunctionName, String parentWithoutTopLevelCommand, String commandName, CommandLine commandLine)
|
| commandLine | back to summary |
|---|---|
| pack-priv final CommandLine commandLine | |
| commandName | back to summary |
|---|---|
| pack-priv final String commandName | |
| functionName | back to summary |
|---|---|
| pack-priv final String functionName | |
| parentFunctionName | back to summary |
|---|---|
| pack-priv final String parentFunctionName | |
| parentWithoutTopLevelCommand | back to summary |
|---|---|
| pack-priv final String parentWithoutTopLevelCommand | |
| CommandDescriptor | back to summary |
|---|---|
| pack-priv CommandDescriptor(String functionName, String parentFunctionName, String parentWithoutTopLevelCommand, String commandName, CommandLine commandLine) | |
| Modifier and Type | Method and Description |
|---|---|
| public V |
| apply | back to summary |
|---|---|
| public V apply(T t) | |
This class can be used as a subcommand for the top-level command in your application. Users can then install completion for the top-level command by running the following command:
source <(top-level-command [sub-command] generate-completion)
| Modifier and Type | Field and Description |
|---|---|
| pack-priv CommandLine. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| spec | back to summary |
|---|---|
| pack-priv CommandLine. | |
| GenerateCompletion | back to summary |
|---|---|
| public GenerateCompletion() | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation. | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public String |
| NullFunction | back to summary |
|---|---|
| private NullFunction() | |
| apply | back to summary |
|---|---|
| public String apply(CharSequence value) Implements picocli. | |
| Modifier and Type | Method and Description |
|---|---|
| public boolean |
| test | back to summary |
|---|---|
| public boolean test(T t) | |