{"modulePath":"github.com/werf/3p-docker-cli","version":"v0.0.0-20241022120545-c34b80bc65ca","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package completion\n\n## Functions\n\n```go\nfunc EnvVarNames(_ *cobra.Command, _ []string, _ string) (names []string, _ cobra.ShellCompDirective)\n```\nEnvVarNames 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.\n\nFor example;\n\n\texport MY_VAR=hello\n\tdocker run --rm --env MY_VAR alpine printenv MY_VAR\n\thello\n\n```go\nfunc FileNames(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective)\n```\nFileNames is a convenience function to use [cobra.ShellCompDirectiveDefault](/github.com/spf13/cobra#ShellCompDirectiveDefault), which indicates to let the shell perform its default behavior after completions have been provided.\n\n```go\nfunc NoComplete(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective)\n```\nNoComplete is used for commands where there's no relevant completion\n\n```go\nfunc Platforms(_ *cobra.Command, _ []string, _ string) (platforms []string, _ cobra.ShellCompDirective)\n```\nPlatforms offers completion for platform-strings. It provides a non-exhaustive list of platforms to be used for completion. Platform-strings are based on [runtime.GOOS](/runtime#GOOS) and [runtime.GOARCH](/runtime#GOARCH), but with (optional) variants added. A list of recognised os/arch combinations from the Go runtime can be obtained through \"go tool dist list\".\n\nSome noteworthy exclusions from this list:\n\n  - arm64 images (\"windows/arm64\", \"windows/arm64/v8\") do not yet exist for windows.\n  - we don't (yet) include \\`os-variant\\` for completion (as can be used for Windows images)\n  - we don't (yet) include platforms for which we don't build binaries, such as BSD platforms (freebsd, netbsd, openbsd), android, macOS (darwin).\n  - we currently exclude architectures that may have unofficial builds, but don't have wide adoption (and no support), such as loong64, mipsXXX, ppc64 (non-le) to prevent confusion.\n\n## Types\n\n```go\ntype APIClientProvider interface {\n\tClient() client.APIClient\n}\n```\nAPIClientProvider provides a method to get an [client.APIClient](/github.com/docker/docker/client#APIClient), initializing it if needed.\n\nIt's a smaller interface than \\[command.Cli], and used in situations where an APIClient is needed, but we want to postpone initializing the client until it's used.\n\n```go\ntype ValidArgsFn func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)\n```\nValidArgsFn a function to be used by cobra command as \\`ValidArgsFunction\\` to offer command line completion\n\n```go\nfunc ContainerNames(dockerCLI APIClientProvider, all bool, filters ...func(container.Summary) bool) ValidArgsFn\n```\nContainerNames offers completion for container names and IDs By default, only names are returned. Set DOCKER\\_COMPLETION\\_SHOW\\_CONTAINER\\_IDS=yes to also complete IDs.\n\n```go\nfunc FromList(options ...string) ValidArgsFn\n```\nFromList offers completion for the given list of options.\n\n```go\nfunc ImageNames(dockerCLI APIClientProvider) ValidArgsFn\n```\nImageNames offers completion for images present within the local store\n\n```go\nfunc NetworkNames(dockerCLI APIClientProvider) ValidArgsFn\n```\nNetworkNames offers completion for networks\n\n```go\nfunc VolumeNames(dockerCLI APIClientProvider) ValidArgsFn\n```\nVolumeNames offers completion for volumes\n\n","path":"github.com/werf/3p-docker-cli/cli/command/completion","name":"completion","synopsis":"","isRedistributable":true}
