Kylin Wget 用法与参数说明
================================================================================
说明：左侧为命令示例，右侧为对应参数说明（短选项,长选项 中文描述）。
      命令名 wget 即 Kylin Wget 可执行程序；与 GNU wget 1.20.x 命令行兼容。
================================================================================

【基本用法】
wget                                    无参数且无 URL 时，输出用法提示并退出
wget URL                                下载单个 URL，保存为 URL 路径中的文件名
wget URL1 URL2 ...                      依次下载多个 URL
wget -h                                 -h,--help              显示帮助信息
wget --help                             -h,--help              显示帮助信息（同上）
wget -V                                 -V,--version           显示版本信息并退出
wget --version                          -V,--version           显示版本信息并退出（同上）

【输出与日志】
wget -O file.txt URL                    -O,--output-document   将下载内容写入 FILE（- 表示标准输出）；多次指定时最后一个生效
wget -O - URL                           -O,--output-document   将内容输出到标准输出（stdout）
wget -P /data URL                       -P,--directory-prefix  将文件保存到 PREFIX/ 目录下
wget -o wget.log URL                    -o,--output-file       将运行日志写入 FILE
wget -a wget.log URL                    -a,--append-output     将运行日志追加写入 FILE
wget -q URL                             -q,--quiet             安静模式，不输出过程信息
wget -v URL                             -v,--verbose           详尽输出（默认开启，除非 -q 或 --no-verbose）
wget -nv URL                            --no-verbose / -n v    关闭详尽输出，仅保留简要信息
wget -n v URL                           -n <FLAGS>             兼容 GNU -nv：-n 后跟 v 关闭 verbose
wget --show-progress URL                --show-progress        强制显示下载进度（即使 --no-verbose；-q 时仍关闭）
wget --progress=bar URL                 --progress             选择进度条类型（如 bar、dot、dot:mega）
wget -b URL                             -b,--background        启动后转入后台运行
wget -S URL                             -S,--server-response   将 HTTP 响应头输出到 stderr
wget --save-headers URL                 --save-headers         将响应头保存到输出文件正文之前

【下载控制】
wget -c URL                             -c,--continue          续传未完成的下载（断点续传）
wget -N URL                             -N,--timestamping      时间戳模式：仅当远端文件比本地新时才下载
wget --use-server-timestamps URL        --use-server-timestamps 下载成功后用服务器 Last-Modified 设置本地文件时间
wget --no-use-server-timestamps URL     --no-use-server-timestamps 不用服务器时间设置本地文件时间
wget --no-clobber URL                   --no-clobber / -nc     不覆盖已存在的本地文件（跳过并保留原内容）
wget -nc URL                            --no-clobber / -nc     同上（短写形式）
wget --clobber URL                      --clobber              允许覆盖文件（与 --no-clobber 按出现顺序决定）
wget --clobber=off URL                  --clobber              显式关闭覆盖（=off）
wget --start-pos=1024 URL               --start-pos            从字节 OFFSET 处开始下载（HTTP Range；与 -c 互斥）
wget --max-redirect=0 URL               --max-redirect         每页允许的最大重定向次数（0 表示禁止跟随重定向）
wget -t 3 URL                           -t,--tries             失败重试次数（0 表示不限次数）
wget --retry-on-http-error=503,404 URL  --retry-on-http-error  将指定 HTTP 状态码视为可重试错误（逗号分隔）
wget --retry-connrefused URL            --retry-connrefused    连接被拒绝时仍重试
wget --retry-on-host-error URL          --retry-on-host-error  主机/DNS 错误时仍重试
wget -T 30 URL                          -T,--timeout           将所有超时统一设为 SECONDS 秒
wget --connect-timeout=10 URL           --connect-timeout      设置连接超时（秒）
wget --read-timeout=60 URL              --read-timeout         设置读取超时（秒）
wget --limit-rate=200k URL              --limit-rate           限制下载速率（如 50k、2m）
wget --content-disposition URL          --content-disposition  使用重定向 URL 最后一段或 Content-Disposition 作为本地文件名
wget --content-on-error URL             --content-on-error     HTTP 错误状态码时仍将响应体写入输出

【输入来源】
wget -i urls.txt                        -i,--input-file        从 FILE 中读取 URL 列表（每行一个）
wget -nc -i urls.txt                    -i + --no-clobber      批量下载并跳过已存在文件（显式 -O 时跳过退出码为 1）
wget -F -i page.html                    -F,--force-html        将输入文件按 HTML 解析并提取链接（与 -i 联用）
wget -B http://host/ -i links.html      -B,--base              解析 -i/-F 中相对链接的基准 URL
wget --config=/etc/wgetrc URL           --config               指定配置文件
wget --no-config URL                    --no-config            不读取任何配置文件
wget -e robots=off URL                  -e,--execute           执行 .wgetrc 风格命令（可多次，后者覆盖前者）

【递归与镜像】
wget -r URL                             -r,--recursive         递归下载链接页面
wget -m URL                             -m,--mirror            镜像站点（隐含 -r -N -l 0）
wget -l 2 -r URL                        -l,--level             最大递归深度（0 表示无限）
wget -p -r URL                          -p,--page-requisites   下载显示 HTML 页面所需的图片等资源
wget -k -r URL                          -k,--convert-links     转换已下载 HTML 中的链接以便本地浏览
wget -K -r URL                          -K,--backup-converted  转换链接前将原文件备份为 .orig
wget --convert-file-only -k URL         --convert-file-only    仅转换 URL 中的文件部分
wget --delete-after -r URL              --delete-after         下载完成后删除本地文件
wget --no-parent -r URL                 --no-parent            递归时不进入父目录
wget --no-directories -r URL            --no-directories       递归时不创建目录层次
wget -x URL                             -x,--force-directories 强制按 URL 路径创建目录
wget --cut-dirs=1 -r URL                --cut-dirs             忽略远程路径中 NUMBER 级目录
wget --no-host-directories -r URL       --no-host-directories  不创建以主机名命名的顶层目录
wget --host-directories -r URL          --host-directories     创建以主机名命名的目录
wget --protocol-directories -r URL      --protocol-directories 在目录名中使用协议名（http、https 等）
wget --default-page=index.html URL      --default-page         目录 URL 的默认页名（默认 index.html；重复指定后者生效）
wget -A .html,.css -r URL               -A,--accept            接受的扩展名列表（逗号分隔；可多次追加）
wget -R .exe,.zip -r URL                -R,--reject            拒绝的扩展名列表（逗号分隔；可多次追加）
wget -D host1,host2 -r URL              -D,--domains           允许跟随的域列表（逗号分隔）
wget --exclude-domains=bad.com -r URL   --exclude-domains      排除的域列表（逗号分隔）
wget -H -r URL                          -H,--span-hosts        递归时跟随外部主机链接
wget -L -r URL                          -L,--relative          仅跟随相对链接
wget -I /pub -r URL                     -I,--include-directories 允许下载的目录列表
wget -X /private -r URL                 -X,--exclude-directories 排除的目录列表
wget --accept-regex='.*\.html$' -r URL  --accept-regex         接受 URL 的正则表达式
wget --reject-regex='.*\.cgi$' -r URL   --reject-regex         拒绝 URL 的正则表达式
wget --robots=off -r URL                --robots               是否遵守 robots.txt（默认开启；=off 关闭）
wget --https-only -r URL                --https-only           递归时仅跟随 HTTPS 链接
wget --backups=3 URL                    --backups              写入前最多保留 N 个备份文件
wget --remove-listing URL               --remove-listing       删除 FTP 检索生成的 .listing 文件
wget -E URL                             -E,--adjust-extension  按 Content-Type 为 HTML/CSS 保存合适扩展名

【HTTP 请求】
wget --header='X-Custom: val' URL       --header               在请求中插入自定义 HTTP 头（可多次）
wget -U 'MyAgent/1.0' URL               -U,--user-agent        设置 User-Agent
wget --referer=http://ref/ URL          --referer              设置 Referer 请求头
wget --method=PUT --body-data='x' URL   --method               指定 HTTP 方法（与 --body-data/--body-file 联用）
wget --body-data='data' URL             --body-data            请求体字符串（须配合 --method）
wget --body-file=body.bin URL           --body-file            从文件读取请求体（须配合 --method）
wget --post-data='k=v' URL              --post-data            POST 请求体字符串（与 --method 互斥）
wget --post-file=form.txt URL           --post-file            从文件读取 POST 请求体
wget --spider URL                       --spider               蜘蛛模式：只检查资源是否可用，不保存响应体

【认证】
wget --user=alice --password=secret URL --user                 用户名（HTTP 等协议通用后备凭据）
                                        --password             密码
wget --http-user=alice URL              --http-user            HTTP 认证用户名
wget --http-password=secret URL         --http-password        HTTP 认证密码
wget --auth-no-challenge URL            --auth-no-challenge    不等待 401 质询即发送 Basic 认证
wget --netrc URL                        --netrc                从 ~/.netrc 读取凭据（默认开启）
wget --no-netrc URL                     --no-netrc             不从 ~/.netrc 读取凭据

【HTTPS / TLS】
wget https://host/path                  （默认）               校验 TLS 证书；失败时 exit 5，并创建 -O 指定的空文件
wget --ca-certificate=ca.pem URL        --ca-certificate       指定信任的 CA 证书包（PEM 文件）
wget --ca-directory=/etc/ssl/certs URL  --ca-directory         指定信任的 CA 证书目录（读取目录下 PEM）
wget --check-certificate URL            --check-certificate    校验 TLS 证书（默认开启；=off 关闭）
wget --no-check-certificate URL         --no-check-certificate 不校验 TLS 证书（仅测试/内网使用）

【FTP】
wget ftp://host/file                    （FTP 协议）           通过 FTP 下载文件
wget --ftp-user=user URL                --ftp-user             FTP 用户名
wget --ftp-password=pass URL            --ftp-password         FTP 密码

【代理】
wget --proxy=http://proxy:8080 URL      --proxy                使用指定代理 URL（缺省 scheme 时为 http://）
wget --no-proxy URL                     --no-proxy             不使用任何代理（忽略 http_proxy 等环境变量）
wget --proxy-user=u --proxy-password=p  --proxy-user           代理认证用户名
                                        --proxy-password       代理认证密码

【Cookie / HSTS】
wget --no-cookies URL                   --no-cookies           禁用 Cookie
wget --load-cookies=cookies.txt URL     --load-cookies         会话前从 FILE 加载 Cookie
wget --save-cookies=cookies.txt URL     --save-cookies         会话后将 Cookie 保存到 FILE
wget --keep-session-cookies URL         --keep-session-cookies 加载并保存会话 Cookie
wget --hsts URL                         --hsts                 启用 HSTS（默认开启）
wget --no-hsts URL                      --no-hsts              禁用 HSTS
wget --hsts-file=~/.wget-hsts URL       --hsts-file            指定 HSTS 数据库路径

【网络与文件名】
wget -4 URL                             -4,--inet4-only        仅使用 IPv4 连接
wget -6 URL                             -6,--inet6-only        仅使用 IPv6 连接
wget --iri URL                          --iri                  启用 IRI（国际化资源标识符）支持
wget --no-iri URL                       --no-iri               关闭 IRI 支持
wget --restrict-file-names=unix URL     --restrict-file-names  限制本地文件名中的字符（unix/windows/vms 等）
wget --trust-server-names URL           --trust-server-names   使用服务端建议的文件名
wget --report-speed=bits URL            --report-speed         以 bits 等单位报告带宽

【常用组合示例】
wget -N http://host/file.txt            本地较新则跳过下载，保留已有文件
wget -nc -O out.txt -i list.txt         批量下载到同一文件，已存在则跳过（退出码 1）
wget -c -O big.iso URL                  断点续传大文件
wget -m -k -p http://site/              镜像站点并转换链接、下载页面资源
wget -nv -O f.txt https://host/f        简要模式下载 HTTPS 文件
wget --ca-certificate=ca.pem -O f URL   使用自定义 CA 下载 HTTPS
wget -r -l 1 --no-directories URL       仅递归一层且不建目录层次

【退出码说明】
  0  成功（或批量下载中至少有一个 URL 成功写入）
  1  通用错误（如显式 -O 时 -nc 跳过已存在文件）
  2  命令行/用法错误
  3  文件 I/O 错误
  4  网络连接失败
  5  SSL/TLS 证书校验失败
  6  服务端认证失败（如 HTTP Basic 密码错误）
  8  服务端返回错误（如 HTTP 4xx/5xx、重定向超限）

================================================================================
更多选项请执行：wget --help
文档版本：Kylin Wget（Rust 实现，行为对齐 GNU Wget 1.20.x 命令行）
================================================================================
