docs: improve command parameter documentation in README_ZH.md(命令注释与参数说明)

Open Beginner friendly
#319 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Domain
documentation

Research direction

Read the “安装 → 准备工作” and “使用 → 连接到 CN 主节点执行 SQL” sections in README_ZH.md. Check the existing variable setup and psql commands, then add Chinese explanations for the variables, flags, and values that readers need to replace. Done when both command blocks explain their purpose and parameters while leaving the original commands unchanged.

Written by the indexing model from the issue text.

Description

背景

参加 OpenTenBase 90 分钟开源贡献挑战,选题:「让命令可以看懂——命令注释与参数说明」。

初学者阅读 README_ZH.md 时,环境变量配置和 psql 连接命令缺少说明:

  • 不理解 PG_HOME、${INSTALL_PATH} 从哪里来、有什么用;
  • 不理解 psql -h/-p/-U/-d 各参数含义;
  • 不知道 ${CoordinateNode_IP}、${CoordinateNode_PORT}、opentenbase、postgres 需要根据实际环境替换。

修改内容(仅 README_ZH.md,14 行纯新增,0 删除)

1. 「安装 → 准备工作」环境变量命令块
  • 代码块前新增前置说明:INSTALL_PATH 需已在前面的「编译」步骤中定义(否则跳过编译直接用安装包时变量为空);
  • 为 4 条命令各加 1 行中文注释(PG_HOME 来源与用途、PATH 追加 bin、LD_LIBRARY_PATH 追加 lib、LC_ALL=C 保守描述)。
2. 「使用 → 连接到 CN 主节点执行 SQL」psql 命令块
  • 代码块前新增说明:该命令用于连接到 OpenTenBase 的 CoordinateNode(CN)执行 SQL;
  • 为 2 条命令加中文注释,逐个解释 -h(连接的主机)、-p(数据库服务器端口)、-U(数据库用户名)、-d(要连接的数据库名);
  • 明确标注需替换参数:${CoordinateNode_IP}、${CoordinateNode_PORT}(示例见上文 11000)、用户名 opentenbase、数据库名 postgres。

原则与依据

  • 不改变任何原有命令:6 条原命令逐字保留(含原有空格),仅新增 # 注释和 > 说明;
  • 解释均有项目内依据:-h/-p/-U/-d 依据 src/bin/psql/help.c(83/129/133/139 行)与 src/bin/psql/startup.c;LD_LIBRARY_PATH 用途参考 src/bin/pg_upgrade/test.sh:79 注释及 src/Makefile.global.in 中 libdir 定义;
  • 不做无依据的保证:未声称连接一定成功;LD_LIBRARY_PATH 未写成"必须";LC_ALL=C 项目内无明文解释,仅保留最保守描述;11000 仅作为文档现有示例端口,非固定值。

涉及文件

  • README_ZH.md(1 file changed, 14 insertions(+), 0 deletions(-))

README_ZH.md

Dominant language
C
Stars
946
Forks
693
Avg merge
5m
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenTenBase/OpenTenBase

All issues in OpenTenBase/OpenTenBase

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.