# shellcheck shell=dash

x log init perl

xrc:mod:lib     perl        __setarg_ enginerun load subcmd co

# Parsing the argument ...
___x_cmd_perl___main(){
    [ "$#" -gt 0 ] || {
        ___x_cmd_perl___cmd perl --help
        return
    }

    local op="$1"; shift
    case "$op" in
        load)           ___x_cmd_perl_load "$@" ;;
        loaded)         ___x_cmd_perl_loaded ;;

        tidy)           ___x_cmd_perl_tidy "$@" ;;

        ,|，|co)        ___x_cmd_perl_co "$@" ;;
        ,,|，，|coco)   ___x_cmd_perl_coco "$@" ;;

        "$___X_CMD_ENGINE_SUBCMD_NAME")
                        ___x_cmd_perl___enginerun "$@" ;;
        *)              ___x_cmd_perl___enginerun "$op" "$@" ;;
    esac
}

___x_cmd_perl___cmd(){
    ___x_cmd_perl_load || return
    # shellcheck disable=SC2317
    ___x_cmd_perl___cmd(){
        command "$@"
    }
    ___x_cmd_perl___cmd "$@"
}
