Skip to content

Commit ec65d19

Browse files
authored
Merge pull request #402 from Peefy/chore-clean-cmd-dollars
chore: clean cmd dollars
2 parents 0690f4b + 3443719 commit ec65d19

File tree

24 files changed

+164
-150
lines changed

24 files changed

+164
-150
lines changed

docs/tools/cli/package-management/command-reference/1.init.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ Show help for `kcl mod init` command.
2828

2929
```shell
3030
# create an empty directory
31-
$ mkdir my_package
31+
mkdir my_package
3232

3333
# cd into the directory
34-
$ cd my_package
34+
cd my_package
3535

3636
# init the current directory into a kcl package
37-
$ kcl mod init
37+
kcl mod init
3838
```
3939

4040
### Init a kcl package with a name

docs/tools/cli/package-management/command-reference/8.push.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ You can use `kcl mod push` under the kcl package root directory to upload a kcl
3030

3131
```shell
3232
# create a new kcl package.
33-
$ kcl mod init <package_name>
33+
kcl mod init <package_name>
3434
# enter the kcl package root directory
35-
$ cd <package_name>
35+
cd <package_name>
3636
# push it to an oci registry
37-
$ kcl mod push <oci_url>
37+
kcl mod push <oci_url>
3838
```
3939

4040
### push a tar to the registry

docs/user_docs/getting-started/kcl-quick-start.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,13 @@ servers = [
6565

6666
where `#` begins with a line comment. The value of `owner` is a dictionary. The value of the dictionary contains the content in the form of `{}`. The key-value inside the dictionary is similar to the `hello = "KCL"` example. `database` is another dictionary in which the value of the dictionary attribute appears boolean `True`, list `[]` and dictionary `{}`, in which the value of the numeric type also appears in the list and dictionary. The `servers` attribute is a list with dictionaries nested inside the list (dictionaries and lists, as well as the `schema` that will be discussed later, can be nested within each other).
6767

68-
The YAML output of this configuration is as follows:
68+
The command and the YAML output of this configuration is as follows:
69+
70+
```shell
71+
kcl server.k
72+
```
6973

7074
```yaml
71-
$ kcl server.k
7275
title: KCL Example
7376
owner:
7477
name: The KCL Authors

docs/user_docs/guides/package-management/4-how-to/4-share_your_pkg.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ If you already have a directory containing kcl files `exist_kcl_package`, you ca
4747

4848
```shell
4949
# In the exist_kcl_package directory
50-
$ pwd
50+
pwd
5151
/home/user/exist_kcl_package
5252

5353
# Run the `kcl mod init` command to create the `kcl.mod` and `kcl.mod.lock` files
54-
$ kcl mod init
54+
kcl mod init
5555
```
5656

5757
For more information on how to use `kcl mod init`, see [kcl mod init](https://kcl-lang.io/docs/tools/cli/package-management/command-reference/init).
@@ -62,11 +62,11 @@ You can use the following command in the root directory of your `kcl` package:
6262

6363
```shell
6464
# In the root directory of the exist_kcl_package package
65-
$ pwd
65+
pwd
6666
/home/user/exist_kcl_package
6767

6868
# Pushing the KCL Package to Default OCI Registry
69-
$ kcl mod push
69+
kcl mod push
7070
```
7171

7272
After completing these steps, you have successfully pushed your KCL Package to the default OCI Registry.

docs/user_docs/guides/package-management/4-how-to/9-kpm_oci.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ You can use `kcl registry login` in four ways.
6161
#### 1. Login OCI Registry with account and password
6262

6363
```shell
64-
$ kcl registry login -u <account_name> -p <password> <oci_registry>
65-
Login succeeded
64+
kcl registry login -u <account_name> -p <password> <oci_registry>
6665
```
6766

6867
For the example, the command is as follows:
@@ -74,23 +73,23 @@ kcl registry login -u test -p 1234 localhost:5001
7473
#### 2. Login OCI Registry with account and interactive input password
7574

7675
```shell
77-
$ kcl registry login -u <account_name> <oci_registry>
76+
kcl registry login -u <account_name> <oci_registry>
7877
Password:
7978
Login succeeded
8079
```
8180

8281
For the example, the command is as follows:
8382

8483
```shell
85-
$ kcl registry login -u test localhost:5001
84+
kcl registry login -u test localhost:5001
8685
Password: 1234
8786
Login succeeded
8887
```
8988

9089
#### 3. Login OCI Registry with interactive input account and password
9190

9291
```shell
93-
$ kcl registry login <oci_registry>
92+
kcl registry login <oci_registry>
9493
Username: <account_name>
9594
Password:
9695
Login succeeded
@@ -99,7 +98,7 @@ Login succeeded
9998
For the example, the command is as follows:
10099

101100
```shell
102-
$ kcl registry login localhost:5001
101+
kcl registry login localhost:5001
103102
Username: test
104103
Password: 1234
105104
Login succeeded
@@ -125,38 +124,38 @@ You can use `kcl mod push` to upload a KCL package to an OCI Registry.
125124

126125
```shell
127126
# Create a new kcl package.
128-
$ kcl mod init <package_name>
127+
kcl mod init <package_name>
129128
# Enter the root directory of the kcl package
130-
$ cd <package_name>
129+
cd <package_name>
131130
# Upload the kcl package to an oci registry
132-
$ kcl mod push
131+
kcl mod push
133132
```
134133

135134
For the example, the commands are as follows:
136135

137136
```shell
138-
$ kcl mod init MyPkg
139-
$ cd MyPkg
140-
$ kcl mod push
137+
kcl mod init MyPkg
138+
cd MyPkg
139+
kcl mod push
141140
```
142141

143142
You can also specify the url of the OCI registry in the `kcl mod push` command.
144143

145144
```shell
146145
# Create a new kcl package.
147-
$ kcl mod init <package_name>
146+
kcl mod init <package_name>
148147
# Enter the root directory of the kcl package
149148
$ cd <package_name>
150149
# Upload the kcl package to an oci registry
151-
$ kcl mod push <oci_url>
150+
kcl mod push <oci_url>
152151
```
153152

154153
For the example, you can push the kcl package to `localhost:5001` by the command
155154

156155
```shell
157-
$ kcl mod init MyPkg
158-
$ cd MyPkg
159-
$ kcl mod push oci://localhost:5001/test/MyPkg --tag v0.1.0
156+
kcl mod init MyPkg
157+
cd MyPkg
158+
kcl mod push oci://localhost:5001/test/MyPkg --tag v0.1.0
160159
```
161160

162161
### `kcl mod pull` to download a KCL package

docs/user_docs/support/faq-kcl.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,7 +1934,7 @@ print("The value of a is", a)
19341934
assert a == 1
19351935
```
19361936

1937-
In addition, we can also use the kcl-test test tool to write KCL internal test cases
1937+
In addition, we can also use the kcl test tool to write KCL internal test cases
19381938

19391939
Assuming there is a hello.k file, the code is as follows:
19401940

@@ -1952,26 +1952,27 @@ hello = Person {
19521952
Construct the hello_test.k test file with the following contents:
19531953

19541954
```python
1955-
schema TestPerson:
1955+
test_person = lambda {
19561956
a = Person{}
19571957
assert a.name == 'kcl'
1958+
}
19581959

1959-
schema TestPerson_age:
1960+
test_person_age = lambda {
19601961
a = Person{}
19611962
assert a.age == 1
1963+
}
19621964

1963-
schema TestPerson_ok:
1965+
test_person_name_and_age = lambda {
19641966
a = Person{}
19651967
assert a.name == "kcl"
19661968
assert a.age == 1
1969+
}
19671970
```
19681971

1969-
Then execute the kcl-test command in the directory:
1972+
Then execute the kcl test command in the directory:
19701973

1971-
```
1972-
$ kcl-test
1973-
ok /pkg/to/app [365.154142ms]
1974-
$
1974+
```shell
1975+
kcl test
19751976
```
19761977

19771978
## 44. How to define and use functions in KCL?

i18n/zh-CN/docusaurus-plugin-content-docs/current/tools/cli/package-management/command-reference/1.init.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ kcl mod init [options][package_name]
2828

2929
```shell
3030
# 创建一个目录
31-
$ mkdir my_package
31+
mkdir my_package
3232

3333
# 进入目录
34-
$ cd my_package
34+
cd my_package
3535

3636
# 初始化当前目录为 kcl 包
37-
$ kcl mod init
37+
kcl mod init
3838
```
3939

4040
### 初始化一个名为 my_package 的 kcl 包

i18n/zh-CN/docusaurus-plugin-content-docs/current/tools/cli/package-management/command-reference/8.push.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ kcl mod push [options][kpm_registry]
3030

3131
```shell
3232
# 创建一个 kcl 包
33-
$ kcl mod init <package_name>
33+
kcl mod init <package_name>
3434
# 进入 kcl 包目录
35-
$ cd <package_name>
35+
cd <package_name>
3636
# 上传 kcl 包到 kcl mod registry
37-
$ kcl mod push <oci_url>
37+
kcl mod push <oci_url>
3838
```
3939

4040
### 上传一个 `*.tar` 文件到 kcl mod registry

i18n/zh-CN/docusaurus-plugin-content-docs/current/user_docs/getting-started/kcl-quick-start.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,13 @@ servers = [
6565

6666
其中 `#` 开头的表示行注释。`owner` 的 value 是一个字典,字典的面值通过 `{}` 方式包含的内容,字典内部的 key-value 和 `hello = "KCL"` 例子的写法类似。`database` 则是另一个字典,其中字典属性的 value 出现了布尔 `True`、列表 `[]` 和 `{}` 字典,其中列表和字典中还出现了数值类型的 value。 最后一个 `servers` 属性则是一个列表,列表内部嵌套着字典(字典和列表以及后续将要讲到的 `schema` 都可以相互嵌套)。
6767

68-
该配置输出的 YAML 结果如下:
68+
运行命令和配置输出的 YAML 结果如下:
69+
70+
```shell
71+
kcl server.k
72+
```
6973

7074
```yaml
71-
$ kcl server.k
7275
title: KCL Example
7376
owner:
7477
name: The KCL Authors

i18n/zh-CN/docusaurus-plugin-content-docs/current/user_docs/guides/package-management/4-how-to/4-share_your_pkg.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ kcl mod init my_package
4747

4848
```shell
4949
# 在 exist_kcl_package 目录下
50-
$ pwd
50+
pwd
5151
/home/user/exist_kcl_package
5252

5353
# 执行 kcl 包管理init 命令来创建 kcl.mod 和 kcl.mod.lock
54-
$ kcl mod init
54+
kcl mod init
5555
```
5656

5757
关于如何使用 kcl 包管理init 的更多信息,请参阅 [kcl mod init](https://kcl-lang.io/zh-CN/docs/tools/cli/package-management/command-reference/init)
@@ -62,11 +62,11 @@ $ kcl mod init
6262

6363
```shell
6464
# 在 exist_kcl_package 包的根目录下
65-
$ pwd
65+
pwd
6666
/home/user/exist_kcl_package
6767

6868
# 推送 kcl 包到默认的 OCI Registry
69-
$ kcl mod push
69+
kcl mod push
7070
```
7171

7272
完成上述步骤后,您就成功地将您的 kcl 包推送到了默认的 OCI Registry 中。

0 commit comments

Comments
 (0)