DockerCLI/cli/command
Sebastiaan van Stijn d914a3f97e
cli/command/completion: add EnvVarNames utility
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

Before this patch:

    docker run --env GO
    GO111MODULE=auto        GOLANG_VERSION=1.21.12  GOPATH=/go              GOTOOLCHAIN=local

With this patch:

    docker run --env GO<tab>
    GO111MODULE     GOLANG_VERSION  GOPATH          GOTOOLCHAIN

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit e3427f341b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-19 01:56:24 +02:00
..
builder chore: remove backticks and resolve linting issues 2024-04-02 15:54:29 +02:00
checkpoint cli/command: don't use pflags.XXXVarP for flags without shorthand 2024-01-29 11:16:38 +01:00
commands remove exec, push, pull, ps, images, info from "legacy" commands 2022-04-08 16:55:39 +02:00
completion cli/command/completion: add EnvVarNames utility 2024-07-19 01:56:24 +02:00
config Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
container cli/command/completion: add EnvVarNames utility 2024-07-19 01:56:24 +02:00
context Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
formatter Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
idresolver Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
image Enable completion for 'image' sub commands 2024-07-19 01:55:35 +02:00
inspect Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
manifest Plumb contexts through commands 2023-12-12 22:30:16 +01:00
network Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
node Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
plugin Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
registry Merge pull request #3599 from thaJeztah/use_local_ConvertToHostname 2024-06-20 16:29:30 +02:00
secret Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
service vendor: github.com/docker/docker 1a1f3cff45ec (master, v27.0-dev) 2024-06-20 13:04:54 +02:00
stack Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
swarm Removed all mentions of "please" from docs and messages 2024-06-11 16:53:40 +02:00
system Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
task linting: address slice-append issues found by gocritic 2023-11-20 16:02:17 +01:00
testdata Dynamically register kubernetes context store endpoint type. 2019-05-20 13:28:11 +01:00
trust Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
volume Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
cli.go cli: make initializing the global meter- and tracing providers optional 2024-06-24 15:44:20 +02:00
cli_options.go cli: Wrap Err stream 2024-06-11 17:59:48 +02:00
cli_options_test.go golangci-lint: enable thelper linter 2023-11-20 16:02:17 +01:00
cli_test.go cli: Wrap Err stream 2024-06-11 17:59:48 +02:00
context.go Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
context_test.go Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
defaultcontextstore.go Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
defaultcontextstore_test.go Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
registry.go use local ConvertToHostname() implementation 2024-06-14 00:25:21 +02:00
registry_test.go linting: fmt.Sprintf can be replaced with string concatenation (perfsprint) 2024-06-10 21:19:32 +02:00
telemetry.go OTel: implement missing MeterProvider `ForceFlush` 2024-05-15 00:05:31 +01:00
telemetry_docker.go Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
telemetry_options.go cli: make initializing the global meter- and tracing providers optional 2024-06-24 15:44:20 +02:00
telemetry_utils.go cli: Wrap Err stream 2024-06-11 17:59:48 +02:00
telemetry_utils_test.go cli: Wrap Err stream 2024-06-11 17:59:48 +02:00
trust.go Refactor content_trust cli/flags handling 2018-03-08 15:00:43 -05:00
utils.go Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
utils_test.go feat: global signal handling with context cancellation 2024-06-07 16:56:34 +02:00