You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: add.go
    path of file: ./repos/podman/cmd/podman/manifest
    
    the code of the file until where you have to start completion: package manifest

import (
	"context"
	"errors"
	"fmt"
	"os"
	"strings"

	"github.com/containers/common/pkg/auth"
	"github.com/containers/common/pkg/completion"
	"github.com/containers/image/v5/types"
	"github.com/containers/podman/v5/cmd/podman/common"
	"github.com/containers/podman/v5/cmd/podman/registry"
	"github.com/containers/p
    
func add(cmd *cobra.Command, args []string) error {
	if cmd.Flags().Changed("authfile") {
		if err := auth.CheckAuthFile(manifestAddOpts.Authfile); err != nil {
			return err
		}
	}

	if manifestAddOpts.credentialsCLI != "" {
		creds, err := util.ParseRegistryCreds(manifestAddOpts.credentialsCLI)
		if err != nil {
			return err
		}
		manifestAddOpts.Username = creds.Username
		manifestAddOpts.Password = creds.Password
	}

	// TLS verification in c/image is controlled via a `types.OptionalBool`
	// which allows for distinguishing among set-true, set-false, unspecified
	// which is important to implement a sane way of dealing with defaults of
	// boolean CLI flags.
	if cmd.Flags().Changed("tls-verify") {
		manifestAddOpts.SkipTLSVerify = types.NewOptionalBool(!manifestAddOpts.tlsVerifyCLI)
	}
	if cmd.Flags().Changed("insecure") {
		if manifestAddOpts.SkipTLSVerify != types.OptionalBoolUndefined {
			return errors.New("--insecure may not be used with --tls-verify")
		}
		manifestAddOpts.SkipTLSVerify = types.NewOptionalBool(manifestAddOpts.insecure)
	}

	if !manifestAddOpts.artifact {
		var changedArtifactFlags []string
		for _, artifactOption := range []string{"artifact-type", "artifact-config", "artifact-config-type", "artifact-layer-type", "artifact-subject", "artifact-exclude-titles"} {
			if cmd.Flags().Changed(artifactOption) {
				changedArtifactFlags = append(changedArtifactFlags, "--"+artifactOption)
			}
		}
		switch {
		case len(changedArtifactFlags) == 1:
			return fmt.Errorf("%s requires --artifact", changedArtifactFlags[0])
		case len(changedArtifactFlags) > 1:
			return fmt.Errorf("%s require --artifact", strings.Join(changedArtifactFlags, "/"))
		}
	}

	var listID string
	var err error
	if manifestAddOpts.artifact {
		if cmd.Flags().Changed("artifact-type") {
			manifestAddOpts.artifactOptions.Type = &manifestAddOpts.artifactType
		}
		if manifestAddOpts.artifactConfigFile != "" {
			configBytes, err := os.ReadFile(manifestAddOpts.artifactConfigFile)
			if err != nil {
				return fmt.Errorf("%v", err)
			}
			manifestAddOpts.artifactOptions.Config = string(configBytes)
		}
		manifestAddOpts.artifactOptions.ManifestAnnotateOptions = manifestAddOpts.ManifestAnnotateOptions
		listID, err = registry.ImageEngine().ManifestAddArtifact(context.Background(), args[0], args[1:], manifestAddOpts.artifactOptions)
		if err != nil {
			return err
		}
	} else {
		listID, err = registry.ImageEngine().ManifestAdd(context.Background(), args[0], args[1:], manifestAddOpts.ManifestAddOptions)
		if err != nil {
			return err
		}
	}
	fmt.Println(listID)
	return nil
}