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

Function setupHelpCommand

cmd/docker/docker.go:209–230  ·  view source on GitHub ↗
(dockerCli command.Cli, rootCmd, helpCmd *cobra.Command)

Source from the content-addressed store, hash-verified

207}
208
209func setupHelpCommand(dockerCli command.Cli, rootCmd, helpCmd *cobra.Command) {
210 origRun := helpCmd.Run
211 origRunE := helpCmd.RunE
212
213 helpCmd.Run = nil
214 helpCmd.RunE = func(c *cobra.Command, args []string) error {
215 if len(args) > 0 {
216 helpcmd, err := pluginmanager.PluginRunCommand(dockerCli, args[0], rootCmd)
217 if err == nil {
218 return helpcmd.Run()
219 }
220 if !errdefs.IsNotFound(err) {
221 return fmt.Errorf("unknown help topic: %v", strings.Join(args, " "))
222 }
223 }
224 if origRunE != nil {
225 return origRunE(c, args)
226 }
227 origRun(c, args)
228 return nil
229 }
230}
231
232func tryRunPluginHelp(dockerCli command.Cli, ccmd *cobra.Command, cargs []string) error {
233 root := ccmd.Root()

Callers 1

newDockerCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…