completion

package
v29.1.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2025 License: Apache-2.0 Imports: 7 Imported by: 1,039

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainerNames

func ContainerNames(dockerCLI APIClientProvider, all bool, filters ...func(container.Summary) bool) cobra.CompletionFunc

ContainerNames offers completion for container names and IDs By default, only names are returned. Set DOCKER_COMPLETION_SHOW_CONTAINER_IDS=yes to also complete IDs.

func EnvVarNames

func EnvVarNames() cobra.CompletionFunc

EnvVarNames offers completion for environment-variable names. This completion can be used for "--env" and "--build-arg" flags, which allow obtaining the value of the given environment-variable if present in the local environment, so we only should complete the names of the environment variables, and not their value. This also prevents the completion script from printing values of environment variables containing sensitive values.

For example;

export MY_VAR=hello
docker run --rm --env MY_VAR alpine printenv MY_VAR
hello

func FileNames

func FileNames() cobra.CompletionFunc

FileNames is a convenience function to use cobra.ShellCompDirectiveDefault, which indicates to let the shell perform its default behavior after completions have been provided.

func FromList

func FromList(options ...string) cobra.CompletionFunc

FromList offers completion for the given list of options.

func ImageNames

func ImageNames(dockerCLI APIClientProvider, limit int) cobra.CompletionFunc

ImageNames offers completion for images present within the local store