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

Function newInspectCommand

cli/command/node/inspect.go:25–44  ·  view source on GitHub ↗
(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

23}
24
25func newInspectCommand(dockerCLI command.Cli) *cobra.Command {
26 var opts inspectOptions
27
28 cmd := &cobra.Command{
29 Use: "inspect [OPTIONS] self|NODE [NODE...]",
30 Short: "Display detailed information on one or more nodes",
31 Args: cli.RequiresMinArgs(1),
32 RunE: func(cmd *cobra.Command, args []string) error {
33 opts.nodeIds = args
34 return runInspect(cmd.Context(), dockerCLI, opts)
35 },
36 ValidArgsFunction: completeNodeNames(dockerCLI),
37 DisableFlagsInUseLine: true,
38 }
39
40 flags := cmd.Flags()
41 flags.StringVarP(&opts.format, "format", "f", "", flagsHelper.InspectFormatHelp)
42 flags.BoolVar(&opts.pretty, "pretty", false, "Print the information in a human friendly format")
43 return cmd
44}
45
46func runInspect(ctx context.Context, dockerCLI command.Cli, opts inspectOptions) error {
47 apiClient := dockerCLI.Client()

Callers 3

TestNodeInspectErrorsFunction · 0.70
TestNodeInspectPrettyFunction · 0.70
newNodeCommandFunction · 0.70

Calls 2

completeNodeNamesFunction · 0.85
runInspectFunction · 0.70

Tested by 2

TestNodeInspectErrorsFunction · 0.56
TestNodeInspectPrettyFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…