(cmd *cobra.Command, platform *string)
| 58 | } |
| 59 | |
| 60 | func InspectOptions(cmd *cobra.Command, platform *string) (types.ImageInspectOptions, error) { |
| 61 | globalOptions, err := helpers.ProcessRootCmdFlags(cmd) |
| 62 | if err != nil { |
| 63 | return types.ImageInspectOptions{}, err |
| 64 | } |
| 65 | mode, err := cmd.Flags().GetString("mode") |
| 66 | if err != nil { |
| 67 | return types.ImageInspectOptions{}, err |
| 68 | } |
| 69 | format, err := cmd.Flags().GetString("format") |
| 70 | if err != nil { |
| 71 | return types.ImageInspectOptions{}, err |
| 72 | } |
| 73 | if platform == nil { |
| 74 | tempPlatform, err := cmd.Flags().GetString("platform") |
| 75 | if err != nil { |
| 76 | return types.ImageInspectOptions{}, err |
| 77 | } |
| 78 | platform = &tempPlatform |
| 79 | } |
| 80 | return types.ImageInspectOptions{ |
| 81 | GOptions: globalOptions, |
| 82 | Mode: mode, |
| 83 | Format: format, |
| 84 | Platform: *platform, |
| 85 | Stdout: cmd.OutOrStdout(), |
| 86 | }, nil |
| 87 | } |
| 88 | |
| 89 | func imageInspectAction(cmd *cobra.Command, args []string) error { |
| 90 | options, err := InspectOptions(cmd, nil) |
no test coverage detected
searching dependent graphs…