# shellcheck shell=dash

xrc:mod:lib     web     db/_index   db/util   tomd   ua   __runcmd

# x webfetch "<url>"    --readablelink  --links     --autobrowser

# 1. ghproxy support.
# 2. readablelink


# Must use agent-0 for quick and cheap model.

# x aifetch "$url"

# default timeout is 30 seconds.

# x webfetch try "<url>"
# x webfetch tomd "<url>"

# x webfetch aitry "<url>"

# x webfetch db get l"<url>"
# x webfetch db set "<url>" -
# x webfetch db set "<url>" "content"


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

    local op="$1";      shift
    case "$op" in
        -h|--help)      ___x_cmd help -m web    "$@" ;  return 0 ;;
        db|tomd|ua|run)
                        ___x_cmd_web_"$op"      "$@" ;;
        fetch)          ___x_cmd webfetch       "$@" ;;
        *)              N=web M="Unknown subcmd -> $op" log:ret:64 ;;
    esac
}
