From 014dc88a3351cea3b053128095bc732420a0ab7bf700ec4470785d96d93b64b0 Mon Sep 17 00:00:00 2001 From: ahdoawhfo Date: Fri, 17 Apr 2026 10:26:27 +0800 Subject: [PATCH] Sync CLI help and README --- README.md | 2 ++ iptables-forward.sh | 1 + tests/test_cli.sh | 1 + 3 files changed, 4 insertions(+) diff --git a/README.md b/README.md index fe41429..1c0654f 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,7 @@ sudo ./iptables-forward.sh --batch add sudo ./iptables-forward.sh --batch list sudo ./iptables-forward.sh --batch save +sudo ./iptables-forward.sh --batch env ``` 参数说明: @@ -141,6 +142,7 @@ tests/run_all.sh --skip-integration 测试覆盖: +- `tests/test_cli.sh`:入口脚本与安装脚本帮助输出 - `tests/test_common.sh`:输入校验 - `tests/test_storage.sh`:规则存储 - `tests/test_env_check.sh`:环境检查与修复 diff --git a/iptables-forward.sh b/iptables-forward.sh index d785091..2c93c45 100644 --- a/iptables-forward.sh +++ b/iptables-forward.sh @@ -36,6 +36,7 @@ usage() { ./iptables-forward.sh --batch delete ./iptables-forward.sh --batch list ./iptables-forward.sh --batch save + ./iptables-forward.sh --batch env ./iptables-forward.sh --help 说明: diff --git a/tests/test_cli.sh b/tests/test_cli.sh index f3c2b0e..01f1a6d 100644 --- a/tests/test_cli.sh +++ b/tests/test_cli.sh @@ -7,6 +7,7 @@ source "${ROOT_DIR}/tests/lib/assert.sh" help_output=$("${ROOT_DIR}/iptables-forward.sh" --help) assert_contains "${help_output}" '--batch add [desc]' 'main script help should describe batch add' +assert_contains "${help_output}" './iptables-forward.sh --batch env' 'main script help should describe batch env' install_help=$("${ROOT_DIR}/install.sh" --help) assert_contains "${install_help}" '仅创建符号链接,不复制源码。' 'install help should explain symlink behavior'