MCPcopy Create free account
hub / github.com/docker/cli / newSecretInspectCommand

Function newSecretInspectCommand

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

Source from the content-addressed store, hash-verified

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

Callers 5

TestSecretInspectErrorsFunction · 0.85
TestSecretInspectPrettyFunction · 0.85
newSecretCommandFunction · 0.85

Calls 2

runSecretInspectFunction · 0.85
completeNamesFunction · 0.70

Tested by 4

TestSecretInspectErrorsFunction · 0.68
TestSecretInspectPrettyFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…