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