(dockerCLI command.Cli)
| 24 | } |
| 25 | |
| 26 | func 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. |
| 46 | func runInspect(ctx context.Context, dockerCLI command.Cli, opts inspectOptions) error { |
searching dependent graphs…