Skip to content

Commit 2667cad

Browse files
committed
chore: format all command documents
Signed-off-by: peefy <[email protected]>
1 parent badad1b commit 2667cad

21 files changed

+76
-116
lines changed

Diff for: cmd/kcl/commands/clean.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ import (
1313
)
1414

1515
const (
16-
cleanDesc = `
17-
This command cleans the kcl build cache.
16+
cleanDesc = `This command cleans the kcl build cache.
1817
`
1918
cleanExample = ` # Clean the build cache
20-
kcl clean
21-
`
19+
kcl clean`
2220
)
2321

2422
// NewCleanCmd returns the clean command.

Diff for: cmd/kcl/commands/doc.go

+4-16
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,12 @@ import (
1010
)
1111

1212
const (
13-
docDesc = `
14-
This command shows documentation for KCL package or symbol.
13+
docDesc = `This command shows documentation for KCL modules or symbols.
1514
`
1615
docExample = ` # Generate document for current package
17-
kcl doc generate
18-
`
19-
docGenDesc = ` # Generate Markdown document for current package
20-
kcl doc generate
21-
22-
# Generate Html document for current package
23-
kcl doc generate --format html
16+
kcl doc generate`
2417

25-
# Generate Markdown document for specific package
26-
kcl doc generate --file-path <package path>
27-
28-
# Generate Markdown document for specific package to a <target directory>
29-
kcl doc generate --file-path <package path> --target <target directory>
18+
docGenDesc = `This command generates documents for KCL modules.
3019
`
3120
docGenExample = ` # Generate Markdown document for current package
3221
kcl doc generate
@@ -38,8 +27,7 @@ This command shows documentation for KCL package or symbol.
3827
kcl doc generate --file-path <package path>
3928
4029
# Generate Markdown document for specific package to a <target directory>
41-
kcl doc generate --file-path <package path> --target <target directory>
42-
`
30+
kcl doc generate --file-path <package path> --target <target directory>`
4331
)
4432

4533
// NewDocCmd returns the doc command.

Diff for: cmd/kcl/commands/fmt.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import (
1111
)
1212

1313
const (
14-
fmtDesc = `
15-
This command formats all kcl files of the current crate.
14+
fmtDesc = `This command formats all kcl files of the current crate.
1615
`
1716
fmtExample = ` # Format the single file
1817
kcl fmt /path/to/file.k

Diff for: cmd/kcl/commands/import.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import (
88
)
99

1010
const (
11-
importDesc = `
12-
This command converts other formats to KCL file.
11+
importDesc = `This command converts other formats to KCL file.
1312
1413
Supported conversion modes:
1514
- json: convert JSON data to KCL data
@@ -40,8 +39,7 @@ Supported conversion modes:
4039
kcl import -m terraformschema schema.json
4140
4241
# Generate KCL models from Go structs
43-
kcl import -m gostruct schema.go
44-
`
42+
kcl import -m gostruct schema.go`
4543
)
4644

4745
// NewImportCmd returns the import command.

Diff for: cmd/kcl/commands/lint.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import (
88
)
99

1010
const (
11-
lintDesc = `
12-
This command lints the kcl code. 'kcl lint' takes multiple input for arguments.
11+
lintDesc = `This command lints the kcl code. 'kcl lint' takes multiple input for arguments.
1312
1413
For example, 'kcl lint path/to/kcl.k' will lint the file named path/to/kcl.k
1514
`
@@ -23,8 +22,7 @@ For example, 'kcl lint path/to/kcl.k' will lint the file named path/to/kcl.k
2322
kcl lint oci://ghcr.io/kcl-lang/hello-world
2423
2524
# Lint the current package
26-
kcl lint
27-
`
25+
kcl lint`
2826
)
2927

3028
// NewLintCmd returns the lint command.

Diff for: cmd/kcl/commands/mod.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import (
77
)
88

99
const (
10-
modDesc = `
11-
This command manages the kcl module
10+
modDesc = `This command manages the kcl module
1211
`
1312
modExample = ` kcl mod <command> [arguments]...
1413
# Init one kcl module

Diff for: cmd/kcl/commands/mod_add.go

+8-9
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,16 @@ import (
1616
)
1717

1818
const (
19-
modAddDesc = `
20-
This command adds new dependency
21-
`
19+
modAddDesc = `This command adds new dependency
20+
`
2221
modAddExample = ` # Add the module dependency named "k8s"
23-
kcl mod add k8s
24-
25-
# Add the module dependency named "k8s" with the version "1.28"
26-
kcl mod add k8s:1.28
22+
kcl mod add k8s
23+
24+
# Add the module dependency named "k8s" with the version "1.28"
25+
kcl mod add k8s:1.28
2726
28-
# Add a local dependency
29-
kcl mod add /path/to/another_module`
27+
# Add a local dependency
28+
kcl mod add /path/to/another_module`
3029
)
3130

3231
// NewModAddCmd returns the mod add command.

Diff for: cmd/kcl/commands/mod_init.go

+6-7
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ import (
1414
)
1515

1616
const (
17-
modInitDesc = `
18-
This command initializes new kcl module in current directory.
19-
`
17+
modInitDesc = `This command initializes new kcl module in current directory.
18+
`
2019
modInitExample = ` kcl mod init <command> [arguments]...
21-
# Init one kcl module with the current folder name
22-
kcl mod init
20+
# Init one kcl module with the current folder name
21+
kcl mod init
2322
24-
# Init one kcl module with the name
25-
kcl mod init package-name`
23+
# Init one kcl module with the name
24+
kcl mod init package-name`
2625
)
2726

2827
// NewModInitCmd returns the mod init command.

Diff for: cmd/kcl/commands/mod_metadata.go

+7-8
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@ import (
1313
)
1414

1515
const (
16-
modMetadataDesc = `
17-
This command outputs the resolved dependencies of a package
18-
`
16+
modMetadataDesc = `This command outputs the resolved dependencies of a package
17+
`
1918
modMetadataExample = ` # Output the resolved dependencies the current module
20-
kcl mod metadata
19+
kcl mod metadata
2120
22-
# Output the resolved dependencies the current module in the vendor mode
23-
kcl mod metadata --vendor
21+
# Output the resolved dependencies the current module in the vendor mode
22+
kcl mod metadata --vendor
2423
25-
# Output the resolved dependencies the current module with the update check
26-
kcl mod metadata --update`
24+
# Output the resolved dependencies the current module with the update check
25+
kcl mod metadata --update`
2726
)
2827

2928
// NewModMetadataCmd returns the mod metadata command.

Diff for: cmd/kcl/commands/mod_pkg.go

+7-8
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@ import (
1414
)
1515

1616
const (
17-
modPkgDesc = `
18-
This command converts a kcl module into tar
19-
`
17+
modPkgDesc = `This command converts a kcl module into tar
18+
`
2019
modPkgExample = ` # Package the current module
21-
kcl mod pkg
20+
kcl mod pkg
2221
23-
# Package the current module in the vendor mode
24-
kcl mod pkg --vendor
22+
# Package the current module in the vendor mode
23+
kcl mod pkg --vendor
2524
26-
# Package the current module into the target directory
27-
kcl mod pkg --target /path/to/target_dir`
25+
# Package the current module into the target directory
26+
kcl mod pkg --target /path/to/target_dir`
2827
)
2928

3029
// NewModPkgCmd returns the mod pkg command.

Diff for: cmd/kcl/commands/mod_pull.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ import (
66
)
77

88
const (
9-
modPullDesc = `
10-
This command pulls kcl modules from the registry.
11-
`
9+
modPullDesc = `This command pulls kcl modules from the registry.
10+
`
1211
modPullExample = ` # Pull the the module named "k8s" to the local path from the registry
13-
kcl mod pull k8s`
12+
kcl mod pull k8s`
1413
)
1514

1615
// NewModPullCmd returns the mod pull command.

Diff for: cmd/kcl/commands/mod_push.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@ import (
1616
)
1717

1818
const (
19-
modPushDesc = `
20-
This command pushes kcl modules to the registry.
21-
`
19+
modPushDesc = `This command pushes kcl modules to the registry.
20+
`
2221
modPushExample = ` # Push the current module to the registry
23-
kcl mod push
22+
kcl mod push
2423
25-
# Push the current module to the registry in the vendor mode
26-
kcl mod push --vendor`
24+
# Push the current module to the registry in the vendor mode
25+
kcl mod push --vendor`
2726
)
2827

2928
// NewModPushCmd returns the mod push command.

Diff for: cmd/kcl/commands/mod_update.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ import (
1111
)
1212

1313
const (
14-
modUpdateDesc = `
15-
This command updates dependencies listed in kcl.mod.lock based on kcl.mod.
16-
`
14+
modUpdateDesc = `This command updates dependencies listed in kcl.mod.lock based on kcl.mod.
15+
`
1716
modUpdateExample = ` # Update the current module
18-
kcl mod update
17+
kcl mod update
1918
20-
# Update the module with the specified path
21-
kcl mod update path/to/package`
19+
# Update the module with the specified path
20+
kcl mod update path/to/package`
2221
)
2322

2423
// NewModUpdateCmd returns the mod update command.

Diff for: cmd/kcl/commands/play.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import (
1212
)
1313

1414
const (
15-
playDesc = `
16-
This command opens the kcl playground in the browser.
15+
playDesc = `This command opens the kcl playground in the browser.
1716
`
1817
playExample = ` # Open in the localhost:80 and open the browser.
1918
kcl play --open

Diff for: cmd/kcl/commands/registry.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ import (
77
)
88

99
const (
10-
registryDesc = `
11-
This command manages the kcl registry
10+
registryDesc = `This command manages the kcl registry
1211
`
1312
registryExample = ` # Login the registry
1413
kcl registry login docker.io
1514
1615
# Logout the registry
17-
kcl registry logout
18-
`
16+
kcl registry logout`
1917
)
2018

2119
var (

Diff for: cmd/kcl/commands/registry_login.go

+8-9
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,17 @@ import (
88
)
99

1010
const (
11-
registryLoginDesc = `
12-
This command can be used to login to a registry.
13-
`
11+
registryLoginDesc = `This command can be used to login to a registry.
12+
`
1413
registryLoginExample = ` # Login the docker hub
15-
kcl registry login docker.io
14+
kcl registry login docker.io
1615
17-
# Login the GitHub container registry
18-
kcl registry login ghcr.io
16+
# Login the GitHub container registry
17+
kcl registry login ghcr.io
1918
20-
# Login a localhost registry
21-
kcl registry login https://localhost:5001
22-
`
19+
# Login a localhost registry
20+
kcl registry login https://localhost:5001
21+
`
2322
)
2423

2524
// NewRegistryLoginCmd returns the registry login command.

Diff for: cmd/kcl/commands/registry_logout.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ import (
77
)
88

99
const (
10-
registryLogoutDesc = `
11-
This command can be used to logout from the current registry.
12-
`
10+
registryLogoutDesc = `This command can be used to logout from the current registry.
11+
`
1312
registryLogoutExample = ` # Logout the registry
14-
kcl registry logout docker.io
15-
`
13+
kcl registry logout docker.io
14+
`
1615
)
1716

1817
// NewRegistryLogoutCmd returns the registry logout command.

Diff for: cmd/kcl/commands/run.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import (
88
)
99

1010
const (
11-
runDesc = `
12-
This command runs the kcl code and displays the output. 'kcl run' takes multiple input for arguments.
11+
runDesc = `This command runs the kcl code and displays the output. 'kcl run' takes multiple input for arguments.
1312
1413
For example, 'kcl run path/to/kcl.k' will run the file named path/to/kcl.k
1514
`
@@ -26,8 +25,7 @@ For example, 'kcl run path/to/kcl.k' will run the file named path/to/kcl.k
2625
kcl run oci://ghcr.io/kcl-lang/hello-world
2726
2827
# Run the current package
29-
kcl run
30-
`
28+
kcl run`
3129
)
3230

3331
// NewRunCmd returns the run command.

Diff for: cmd/kcl/commands/server.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import (
99
)
1010

1111
const (
12-
serverDesc = `
13-
This command runs a kcl server with multiple REST APIs. See https://kcl-lang.io/docs/reference/xlang-api/rest-api for more information.
12+
serverDesc = `This command runs a kcl server with multiple REST APIs. See https://kcl-lang.io/docs/reference/xlang-api/rest-api for more information.
1413
`
1514
serverExample = ` # Run a kcl server
1615
kcl server
@@ -22,8 +21,7 @@ This command runs a kcl server with multiple REST APIs. See https://kcl-lang.io/
2221
curl -X POST http://127.0.0.1:2021/api:protorpc/BuiltinService.ListMethod --data '{}'
2322
2423
# Use the Run API
25-
curl -X POST http://127.0.0.1:2021/api:protorpc/KclvmService.ExecProgram -H "accept: application/json" --data '{"k_filename_list": ["main.k"]}'
26-
`
24+
curl -X POST http://127.0.0.1:2021/api:protorpc/KclvmService.ExecProgram -H "accept: application/json" --data '{"k_filename_list": ["main.k"]}'`
2725
)
2826

2927
var (

Diff for: cmd/kcl/commands/test.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import (
1212
)
1313

1414
const (
15-
testDesc = `
16-
This command automates testing the packages named by the import paths.
15+
testDesc = `This command automates testing the packages named by the import paths.
1716
1817
'KCL test' re-compiles each package along with any files with names matching
1918
the file pattern "*_test.k". These additional files can contain test functions
@@ -29,8 +28,7 @@ that starts with "test_*".
2928
kcl test ./... --fail-fast
3029
3130
# Test with the regex expression filter 'test_func'
32-
kcl test ./... --run test_func
33-
`
31+
kcl test ./... --run test_func`
3432
)
3533

3634
// NewTestCmd returns the test command.

0 commit comments

Comments
 (0)