MCPcopy Index your code
hub / github.com/docker/cli / completeLogOpt

Function completeLogOpt

cli/command/container/completion.go:230–236  ·  view source on GitHub ↗

completeLogOpt implements shell completion for the `--log-opt` option of `run` and `create`. If the user supplied a log-driver, only options for that driver are returned.

(cmd *cobra.Command, _ []string, _ string)

Source from the content-addressed store, hash-verified

228// completeLogOpt implements shell completion for the `--log-opt` option of `run` and `create`.
229// If the user supplied a log-driver, only options for that driver are returned.
230func completeLogOpt(cmd *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) {
231 driver, _ := cmd.Flags().GetString("log-driver")
232 if options, exists := logDriverOptions[driver]; exists {
233 return postfixWith("=", options), cobra.ShellCompDirectiveNoSpace | cobra.ShellCompDirectiveNoFileComp
234 }
235 return postfixWith("=", allLogDriverOptions()), cobra.ShellCompDirectiveNoSpace
236}
237
238// completePid implements shell completion for the `--pid` option of `run` and `create`.
239func completePid(dockerCLI completion.APIClientProvider) cobra.CompletionFunc {

Callers

nothing calls this directly

Calls 1

postfixWithFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…