# shellcheck shell=dash

___x_cmd log init paru
xrc:mod:lib     paru   __install info fz ls

___x_cmd_paru___main(){
    [ "$#" -gt 0 ] ||   set -- --runmain
    local op="$1";      shift

    case "$op" in
        -h|--help)      ___x_cmd help -m paru "$@";    return 0 ;;
    esac

    ___x_cmd_paru___checkcmd || return $?

    case "$op" in
        ls|fz)          ___x_cmd_paru_"$op"                "$@" ;;
        info)           ___x_cmd_paru_"$op"                "$@" ;;

        --runmain)      ___x_cmd_paru___runmain            "$@" ;;
        *)              ___x_cmd_paru___runmain      "$op" "$@" ;;
    esac
}

___x_cmd_paru___runmain(){
    ___x_cmd_paru___checkcmd || return $?
    ___x_cmd_cmds paru "$@"
}

___x_cmd_paru___checkcmd(){
    ___x_cmd_hascmd paru || {
        paru:info "The paru command was not found. Proceeding with installation."
        ___x_cmd_paru___install || return $?
    }
}
