From 03be5825e77ac1d3838bcc07c606f5076d24cd67 Mon Sep 17 00:00:00 2001
From: zhou mao <1831326353@qq.com>
Date: Thu, 21 Sep 2023 10:56:15 +0800
Subject: [PATCH 1/3] Add command help
---
source/tutorial/commands_help.rst | 67 +++++++++++++++++++++++++++++++
source/tutorial/started.rst | 1 +
2 files changed, 68 insertions(+)
create mode 100644 source/tutorial/commands_help.rst
diff --git a/source/tutorial/commands_help.rst b/source/tutorial/commands_help.rst
new file mode 100644
index 0000000000..37ea9b151a
--- /dev/null
+++ b/source/tutorial/commands_help.rst
@@ -0,0 +1,67 @@
+命令帮助
+========
+
+:撰写: |周茂|
+:最近更新日期: 2023-09-21
+
+----
+
+GMT 模块较多,每个模块均包含若干选项,即使经常使用的用户仍难以记忆全部用法。
+GMT 提供了便捷的用法帮助系统,以便用户在使用中随时查阅。
+
+#. 命令行用法帮助
+
+用户可在命令行中直接敲击命令以获取模块用法,例如 ::
+
+ $ gmt plot
+ gmt plot [core] 6.4.0 [64-bit] - Plot lines, polygons, and symbols in 2-D
+
+ usage: gmt plot [
] -J -R///[//][+r] [-V[q|e|w|t|i|c|d]] ...
+
+ REQUIRED ARGUMENTS:
+
+ is one or more data files (in ASCII, binary, netCDF). If no files are given, standard input is read.
+
+ -J Select map proJection ( in cm/degree, in cm). Modifiers:
+ +dh Specifying map height.
+ Azimuthal projections set -Rg unless polar aspect or -R<...>+r is set.
+ -Ja|A/[/]/ (or /)| (Lambert Azimuthal Equal-area)
+
+ OPTIONAL ARGUMENTS:
+
+ -V[q|e|w|t|i|c|d]
+ Change the verbosity level (currently w). Choose among 7 levels; each level adds more detailed messages:
+ e: Error messages only.
+ w: Warnings [Default when no -V is given].
+ t: Timings (time-intensive operations only).
+
+上述示例中给出了 :doc:`/module/basemap` 模块的用法,这里仅截取部分内容以做解释。其中
+
+- 第一行给出模块功能的概述,用户可依此初步判断当前模块是否可实现所需功能
+- ``usage`` 行展示了本模块选项的用法,其中
+ - 尖括号 ``<>`` 表示其中的内容是必须的,用户在使用中需用相应的信息来替换当前内容
+ - 方括号 ``[]`` 表示其中的内容是可选的,用户可根据需求选择是否设置该项
+ - 竖线 ``|`` 的含义为“或”,用户可选取由单个或多个 ``|`` 分隔的任意子选项
+- ``REQUIRED ARGUMENTS`` 表示下面为当前模块必须选项,通常情况下必须设置,
+ 但也可能受其他选项影响
+- ``OPTIONAL ARGUMENTS`` 表示下述的选项为可选选项,用户可自行判断是否需要设置
+- 在每个选项的详细解释中,方括号 ``[]`` 中的内容表示其缺省或默认情况
+
+#. 命令行快速打开 GMT 官方网页文档
+
+GMT 提供了完善的网页文档,若用户通过上述命令行用法仍无法明白如何使用,
+可快速打开网页文档查看详细解释及示例,用法详见 :doc:`/module/docs`。
+网页文档同样采用与上述命令行相同的语法规则。
+
+#. 命令行快速打开中文文档
+
+GMT 中文社区提供了一个与 :doc:`/module/docs` 类似用法的 bash 脚本
+`gmtcn `__,可
+用于在命令行下快速打开中文文档相关界面,经过配置后,用户可如下述方法
+使用该脚本::
+
+ $ gmtcn docs plot
+ $ gmtcn docs -B
+ $ gmtcn docs -JX
+ $ gmtcn docs setting
+ $ gmtcn docs chinese
diff --git a/source/tutorial/started.rst b/source/tutorial/started.rst
index 7f2172a48a..c3f29824dc 100644
--- a/source/tutorial/started.rst
+++ b/source/tutorial/started.rst
@@ -10,6 +10,7 @@
get-started/index
commands
+ commands_help
scripting/index
basemap
coastline
From 9edb370ff6cca5450a0bec3b823cc78241ce6c59 Mon Sep 17 00:00:00 2001
From: zhou mao <1831326353@qq.com>
Date: Thu, 21 Sep 2023 14:44:57 +0800
Subject: [PATCH 2/3] upadte
---
source/tutorial/commands_help.rst | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/source/tutorial/commands_help.rst b/source/tutorial/commands_help.rst
index 37ea9b151a..c87cfb4c16 100644
--- a/source/tutorial/commands_help.rst
+++ b/source/tutorial/commands_help.rst
@@ -9,7 +9,7 @@
GMT 模块较多,每个模块均包含若干选项,即使经常使用的用户仍难以记忆全部用法。
GMT 提供了便捷的用法帮助系统,以便用户在使用中随时查阅。
-#. 命令行用法帮助
+**1. 命令行用法帮助**
用户可在命令行中直接敲击命令以获取模块用法,例如 ::
@@ -35,25 +35,27 @@ GMT 提供了便捷的用法帮助系统,以便用户在使用中随时查阅
w: Warnings [Default when no -V is given].
t: Timings (time-intensive operations only).
-上述示例中给出了 :doc:`/module/basemap` 模块的用法,这里仅截取部分内容以做解释。其中
+上述示例中给出了 :doc:`/module/plot` 模块的用法,这里仅截取部分内容以做解释。其中
- 第一行给出模块功能的概述,用户可依此初步判断当前模块是否可实现所需功能
- ``usage`` 行展示了本模块选项的用法,其中
- - 尖括号 ``<>`` 表示其中的内容是必须的,用户在使用中需用相应的信息来替换当前内容
- - 方括号 ``[]`` 表示其中的内容是可选的,用户可根据需求选择是否设置该项
- - 竖线 ``|`` 的含义为“或”,用户可选取由单个或多个 ``|`` 分隔的任意子选项
+
+ - 尖括号 ``<>`` 表示其中的内容是必须的,用户在使用中需用相应的信息来替换当前内容
+ - 方括号 ``[]`` 表示其中的内容是可选的,用户可根据需求选择是否设置该项
+ - 竖线 ``|`` 的含义为“或”,用户可选取由单个或多个 ``|`` 分隔的任意子选项
+
- ``REQUIRED ARGUMENTS`` 表示下面为当前模块必须选项,通常情况下必须设置,
但也可能受其他选项影响
- ``OPTIONAL ARGUMENTS`` 表示下述的选项为可选选项,用户可自行判断是否需要设置
- 在每个选项的详细解释中,方括号 ``[]`` 中的内容表示其缺省或默认情况
-#. 命令行快速打开 GMT 官方网页文档
+**2. 命令行快速打开 GMT 官方文档**
GMT 提供了完善的网页文档,若用户通过上述命令行用法仍无法明白如何使用,
可快速打开网页文档查看详细解释及示例,用法详见 :doc:`/module/docs`。
网页文档同样采用与上述命令行相同的语法规则。
-#. 命令行快速打开中文文档
+**3. 命令行快速打开中文文档**
GMT 中文社区提供了一个与 :doc:`/module/docs` 类似用法的 bash 脚本
`gmtcn `__,可
From 2e28034998a2c4caed79c93c11bb7e3239d320e1 Mon Sep 17 00:00:00 2001
From: zhou mao <1831326353@qq.com>
Date: Sat, 23 Sep 2023 21:02:02 +0800
Subject: [PATCH 3/3] fix
---
source/tutorial/commands_help.rst | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/source/tutorial/commands_help.rst b/source/tutorial/commands_help.rst
index c87cfb4c16..4a26ec55a2 100644
--- a/source/tutorial/commands_help.rst
+++ b/source/tutorial/commands_help.rst
@@ -53,7 +53,9 @@ GMT 提供了便捷的用法帮助系统,以便用户在使用中随时查阅
GMT 提供了完善的网页文档,若用户通过上述命令行用法仍无法明白如何使用,
可快速打开网页文档查看详细解释及示例,用法详见 :doc:`/module/docs`。
-网页文档同样采用与上述命令行相同的语法规则。
+
+网页文档同样采用与上述命令行相似的语法规则,不同之处为,网页文档中使
+斜体而不是 ``<>`` 表示必须替换的选项或参数。
**3. 命令行快速打开中文文档**