completion

package
v29.5.0-rc.1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 6 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