# shellcheck shell=dash
___x_cmd log init openclaw

xrc:mod:lib     openclaw   __runcmd __install __uninstall service setup

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

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

        service)        ___x_cmd_openclaw_service        "$@" ;;
        start|stop|status|log)
                        ___x_cmd_openclaw_service_"$op" "$@" ;;

        --setup)
                        ___x_cmd_openclaw_setup "$@"    ;;
        --install)      ___x_cmd_openclaw___install "$@" ;;
        --uninstall)    ___x_cmd_openclaw___uninstall "$@" ;;
        --|--runmain)   ___x_cmd_openclaw___runmain "$@" ;;

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


