# shellcheck shell=dash
___x_cmd_dregistry___main(){
    local target="${target:-"docker"}"
    local endpoint
    local token_endpoint
    local service
    case "$target" in
        docker)
            endpoint="registry-1.docker.io"
            token_endpoint="auth.docker.io"
            service="registry.docker.io"
        ;;
        github)
            endpoint="ghcr.io"
            token_endpoint="ghcr.io"
            service="ghcr.io"
        ;;
    esac
    local url="https://$endpoint/v2"
    [ $# -gt 0 ] || {
        x help -m dregistry "$@"
        return 1
    }
    local op="${1}";shift 1
    case "$op" in
        info)
            ___x_cmd_dregistry_info "$@"
        ;;
        download)
            ___x_cmd_dregistry_download "$@"
        ;;
        ""|-h|--help)
            x help -m dregistry "$@"
        ;;
    esac
}
