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

Function getCommandFlags

cli-plugins/manager/hooks.go:208–218  ·  view source on GitHub ↗
(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

206}
207
208func getCommandFlags(cmd *cobra.Command) map[string]string {
209 flags := make(map[string]string)
210 cmd.Flags().Visit(func(f *pflag.Flag) {
211 var fValue string
212 if f.Value.Type() == "bool" {
213 fValue = f.Value.String()
214 }
215 flags[f.Name] = fValue
216 })
217 return flags
218}
219
220// getNaiveFlags string-matches argv and parses them into a map.
221// This is used when calling hooks after a plugin command, since

Callers 1

RunCLICommandHooksFunction · 0.85

Calls 2

StringMethod · 0.65
TypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…