complete
pants complete [args]
Generates a completion script for the specified shell. The script is printed to stdout.
For example, pants complete --zsh > pants-completions.zsh
will generate a zsh completion script and write it to the file my-pants-completions.zsh
. You can then source this file in your .zshrc
file to enable completion for Pants.
This command is also used by the completion scripts to generate the completion options using passthrough options. This usage is not intended for use by end users, but could be useful for building custom completion scripts.
An example of this usage is in the bash completion script, where we use the following command: pants complete -- ${COMP_WORDS[@]}
. This will generate the completion options for the current args, and then pass them to the bash completion script.
Backend: pants.goal
Config section: [complete]