(dockerCLI command.Cli)
| 21 | } |
| 22 | |
| 23 | func newInspectCommand(dockerCLI command.Cli) *cobra.Command { |
| 24 | var opts inspectOptions |
| 25 | |
| 26 | cmd := &cobra.Command{ |
| 27 | Use: "inspect [OPTIONS] VOLUME [VOLUME...]", |
| 28 | Short: "Display detailed information on one or more volumes", |
| 29 | Args: cli.RequiresMinArgs(1), |
| 30 | RunE: func(cmd *cobra.Command, args []string) error { |
| 31 | opts.names = args |
| 32 | return runInspect(cmd.Context(), dockerCLI, opts) |
| 33 | }, |
| 34 | ValidArgsFunction: completion.VolumeNames(dockerCLI), |
| 35 | DisableFlagsInUseLine: true, |
| 36 | } |
| 37 | |
| 38 | cmd.Flags().StringVarP(&opts.format, "format", "f", "", flagsHelper.InspectFormatHelp) |
| 39 | |
| 40 | return cmd |
| 41 | } |
| 42 | |
| 43 | func runInspect(ctx context.Context, dockerCLI command.Cli, opts inspectOptions) error { |
| 44 | apiClient := dockerCLI.Client() |
searching dependent graphs…