code: func RunPull(cli command.Cli, opts PullOptions) error {
  	distributionRef, err := reference.ParseNormalizedNamed(opts.remote)
  	switch {
  	case err != nil:
  		return err
  	case opts.all && !reference.IsNameOnly(distributionRef):
  		return errors.New("tag can't be used with --all-tags/-a")
  	case !opts.all && reference.IsNameOnly(distributionRef):
  		distributionRef = reference.TagNameOnly(distributionRef)
  		if tagged, ok := distributionRef.(reference.Tagged); ok && !opts.quiet {
  			fmt.Fprintf(cli.Out(), "Using default tag: %s\n", tagged.Tag())
  		}
  	}
  
  	ctx := context.Background()
  	imgRefAndAuth, err := trust.GetImageReferencesAndAuth(ctx, nil, AuthResolver(cli), distributionRef.String())
  	if err != nil {
  		return err
  	}
  
  	// Check if reference has a digest
  	_, isCanonical := distributionRef.(reference.Canonical)
  	if !opts.untrusted && !isCanonical {
  		err = trustedPull(ctx, cli, imgRefAndAuth, opts)
  	} else {
  		err = imagePullPrivileged(ctx, cli, imgRefAndAuth, opts)
  	}
  	if err != nil {
  		if strings.Contains(err.Error(), "when fetching 'plugin'") {
  			return errors.New(err.Error() + " - Use `docker plugin install`")
  		}
  		return err
  	}
  	fmt.Fprintln(cli.Out(), imgRefAndAuth.Reference().String())
  	return nil
  }
docs: // RunPull performs a pull against the engine based on the specified options