Module dev.metaschema.cli.processor
Class CompletionScriptGenerator
java.lang.Object
dev.metaschema.cli.processor.completion.CompletionScriptGenerator
Generates shell completion scripts for Bash and Zsh.
This generator introspects registered commands and their options to produce completion scripts that provide intelligent tab-completion for command-line tools built on the cli-processor framework.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSupported shell types. -
Constructor Summary
ConstructorsConstructorDescriptionCompletionScriptGenerator(String programName, List<ICommand> commands) Construct a new generator. -
Method Summary
Modifier and TypeMethodDescriptionGenerate a Bash completion script.Generate a Zsh completion script.Get the commands.Get the program name.
-
Constructor Details
-
CompletionScriptGenerator
Construct a new generator.- Parameters:
programName- the name of the CLI programcommands- the top-level commands to include in completion
-
-
Method Details
-
getProgramName
Get the program name.- Returns:
- the program name
-
getCommands
Get the commands.- Returns:
- the commands
-
generateBashCompletion
Generate a Bash completion script.- Returns:
- the bash completion script
-
generateZshCompletion
Generate a Zsh completion script.- Returns:
- the zsh completion script
-