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

Function newShowCommand

cli/command/context/show.go:12–25  ·  view source on GitHub ↗

newShowCommand creates a new cobra.Command for `docker context sow`

(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

10
11// newShowCommand creates a new cobra.Command for `docker context sow`
12func newShowCommand(dockerCLI command.Cli) *cobra.Command {
13 cmd := &cobra.Command{
14 Use: "show",
15 Short: "Print the name of the current context",
16 Args: cli.NoArgs,
17 RunE: func(cmd *cobra.Command, args []string) error {
18 runShow(dockerCLI)
19 return nil
20 },
21 ValidArgsFunction: cobra.NoFileCompletions,
22 DisableFlagsInUseLine: true,
23 }
24 return cmd
25}
26
27func runShow(dockerCli command.Cli) {
28 fmt.Fprintln(dockerCli.Out(), dockerCli.CurrentContext())

Callers 2

newContextCommandFunction · 0.85
TestUseHostOverrideEmptyFunction · 0.85

Calls 1

runShowFunction · 0.85

Tested by 1

TestUseHostOverrideEmptyFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…