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

Function newConfigInspectCommand

cli/command/config/inspect.go:26–43  ·  view source on GitHub ↗
(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

24}
25
26func newConfigInspectCommand(dockerCLI command.Cli) *cobra.Command {
27 opts := inspectOptions{}
28 cmd := &cobra.Command{
29 Use: "inspect [OPTIONS] CONFIG [CONFIG...]",
30 Short: "Display detailed information on one or more configs",
31 Args: cli.RequiresMinArgs(1),
32 RunE: func(cmd *cobra.Command, args []string) error {
33 opts.names = args
34 return runInspect(cmd.Context(), dockerCLI, opts)
35 },
36 ValidArgsFunction: completeNames(dockerCLI),
37 DisableFlagsInUseLine: true,
38 }
39
40 cmd.Flags().StringVarP(&opts.format, "format", "f", "", flagsHelper.InspectFormatHelp)
41 cmd.Flags().BoolVar(&opts.pretty, "pretty", false, "Print the information in a human friendly format")
42 return cmd
43}
44
45// runInspect inspects the given Swarm config.
46func runInspect(ctx context.Context, dockerCLI command.Cli, opts inspectOptions) error {

Callers 5

TestConfigInspectErrorsFunction · 0.85
TestConfigInspectPrettyFunction · 0.85
newConfigCommandFunction · 0.85

Calls 2

runInspectFunction · 0.70
completeNamesFunction · 0.70

Tested by 4

TestConfigInspectErrorsFunction · 0.68
TestConfigInspectPrettyFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…