| 16 | const pullUsageLongHelp = `Pull an image or a repository from a registry.` |
| 17 | |
| 18 | func newPullCommand() *cobra.Command { |
| 19 | |
| 20 | pull := &pullCommand{} |
| 21 | |
| 22 | cmd := &cobra.Command{ |
| 23 | Use: "pull [OPTIONS] NAME[:TAG|@DIGEST]", |
| 24 | DisableFlagsInUseLine: true, |
| 25 | SilenceUsage: true, |
| 26 | Short: pullUsageShortHelp, |
| 27 | Long: pullUsageLongHelp, |
| 28 | Args: validatePullImageArgs, |
| 29 | RunE: func(cmd *cobra.Command, args []string) error { |
| 30 | return pull.Run(args) |
| 31 | }, |
| 32 | } |
| 33 | |
| 34 | return cmd |
| 35 | } |
| 36 | |
| 37 | func validatePullImageArgs(cmd *cobra.Command, args []string) error { |
| 38 | if len(args) < 1 { |