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)
| 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. |
| 230 | func 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`. |
| 239 | func completePid(dockerCLI completion.APIClientProvider) cobra.CompletionFunc { |
nothing calls this directly
no test coverage detected
searching dependent graphs…