# shellcheck shell=dash

xrc:mod:lib     caddy       __exec

___x_cmd_caddy___main(){
    [ "$#" -gt 0 ] ||   set -- --help

    local op="$1";      shift
    case "$op" in
        -h|--help)      ___x_cmd help -m caddy "$@";    return 0 ;;

        fs)             ___x_cmd_caddy___exec file-server   "$@" ;;
        rp)             ___x_cmd_caddy___exec reverse-proxy "$@" ;;

        --|--exec)      ___x_cmd_caddy___exec               "$@" ;;

        *)              ___x_cmd_caddy___exec   "$op"       "$@" ;;
    esac
}

# TODO: introduce LLM for caddy file templates ...

