diff --git a/cmd/kcl/commands/clean.go b/cmd/kcl/commands/clean.go index 7201170..0886298 100644 --- a/cmd/kcl/commands/clean.go +++ b/cmd/kcl/commands/clean.go @@ -13,12 +13,10 @@ import ( ) const ( - cleanDesc = ` -This command cleans the kcl build cache. + cleanDesc = `This command cleans the kcl build cache. ` cleanExample = ` # Clean the build cache - kcl clean -` + kcl clean` ) // NewCleanCmd returns the clean command. diff --git a/cmd/kcl/commands/doc.go b/cmd/kcl/commands/doc.go index cb0ebda..9b1b1ac 100644 --- a/cmd/kcl/commands/doc.go +++ b/cmd/kcl/commands/doc.go @@ -10,23 +10,12 @@ import ( ) const ( - docDesc = ` -This command shows documentation for KCL package or symbol. + docDesc = `This command shows documentation for KCL modules or symbols. ` docExample = ` # Generate document for current package - kcl doc generate - ` - docGenDesc = ` # Generate Markdown document for current package - kcl doc generate - - # Generate Html document for current package - kcl doc generate --format html + kcl doc generate` - # Generate Markdown document for specific package - kcl doc generate --file-path - - # Generate Markdown document for specific package to a - kcl doc generate --file-path --target + docGenDesc = `This command generates documents for KCL modules. ` docGenExample = ` # Generate Markdown document for current package kcl doc generate @@ -38,8 +27,7 @@ This command shows documentation for KCL package or symbol. kcl doc generate --file-path # Generate Markdown document for specific package to a - kcl doc generate --file-path --target -` + kcl doc generate --file-path --target ` ) // NewDocCmd returns the doc command. diff --git a/cmd/kcl/commands/fmt.go b/cmd/kcl/commands/fmt.go index e85bc14..3238d7a 100644 --- a/cmd/kcl/commands/fmt.go +++ b/cmd/kcl/commands/fmt.go @@ -11,8 +11,7 @@ import ( ) const ( - fmtDesc = ` -This command formats all kcl files of the current crate. + fmtDesc = `This command formats all kcl files of the current crate. ` fmtExample = ` # Format the single file kcl fmt /path/to/file.k diff --git a/cmd/kcl/commands/import.go b/cmd/kcl/commands/import.go index c87b8e6..c721053 100644 --- a/cmd/kcl/commands/import.go +++ b/cmd/kcl/commands/import.go @@ -8,8 +8,7 @@ import ( ) const ( - importDesc = ` -This command converts other formats to KCL file. + importDesc = `This command converts other formats to KCL file. Supported conversion modes: - json: convert JSON data to KCL data @@ -40,8 +39,7 @@ Supported conversion modes: kcl import -m terraformschema schema.json # Generate KCL models from Go structs - kcl import -m gostruct schema.go -` + kcl import -m gostruct schema.go` ) // NewImportCmd returns the import command. diff --git a/cmd/kcl/commands/lint.go b/cmd/kcl/commands/lint.go index 7716aeb..ef52cfb 100644 --- a/cmd/kcl/commands/lint.go +++ b/cmd/kcl/commands/lint.go @@ -8,8 +8,7 @@ import ( ) const ( - lintDesc = ` -This command lints the kcl code. 'kcl lint' takes multiple input for arguments. + lintDesc = `This command lints the kcl code. 'kcl lint' takes multiple input for arguments. For example, 'kcl lint path/to/kcl.k' will lint the file named path/to/kcl.k ` @@ -23,8 +22,7 @@ For example, 'kcl lint path/to/kcl.k' will lint the file named path/to/kcl.k kcl lint oci://ghcr.io/kcl-lang/hello-world # Lint the current package - kcl lint - ` + kcl lint` ) // NewLintCmd returns the lint command. diff --git a/cmd/kcl/commands/mod.go b/cmd/kcl/commands/mod.go index 6ce2b83..7b22851 100644 --- a/cmd/kcl/commands/mod.go +++ b/cmd/kcl/commands/mod.go @@ -7,8 +7,7 @@ import ( ) const ( - modDesc = ` -This command manages the kcl module + modDesc = `This command manages the kcl module ` modExample = ` kcl mod [arguments]... # Init one kcl module diff --git a/cmd/kcl/commands/mod_add.go b/cmd/kcl/commands/mod_add.go index 52467a5..4aa5880 100644 --- a/cmd/kcl/commands/mod_add.go +++ b/cmd/kcl/commands/mod_add.go @@ -16,17 +16,16 @@ import ( ) const ( - modAddDesc = ` - This command adds new dependency - ` + modAddDesc = `This command adds new dependency +` modAddExample = ` # Add the module dependency named "k8s" - kcl mod add k8s - - # Add the module dependency named "k8s" with the version "1.28" - kcl mod add k8s:1.28 + kcl mod add k8s + + # Add the module dependency named "k8s" with the version "1.28" + kcl mod add k8s:1.28 - # Add a local dependency - kcl mod add /path/to/another_module` + # Add a local dependency + kcl mod add /path/to/another_module` ) // NewModAddCmd returns the mod add command. diff --git a/cmd/kcl/commands/mod_init.go b/cmd/kcl/commands/mod_init.go index f8d0c99..c9dfb49 100644 --- a/cmd/kcl/commands/mod_init.go +++ b/cmd/kcl/commands/mod_init.go @@ -14,15 +14,14 @@ import ( ) const ( - modInitDesc = ` - This command initializes new kcl module in current directory. - ` + modInitDesc = `This command initializes new kcl module in current directory. +` modInitExample = ` kcl mod init [arguments]... - # Init one kcl module with the current folder name - kcl mod init + # Init one kcl module with the current folder name + kcl mod init - # Init one kcl module with the name - kcl mod init package-name` + # Init one kcl module with the name + kcl mod init package-name` ) // NewModInitCmd returns the mod init command. diff --git a/cmd/kcl/commands/mod_metadata.go b/cmd/kcl/commands/mod_metadata.go index 24a5398..c176644 100644 --- a/cmd/kcl/commands/mod_metadata.go +++ b/cmd/kcl/commands/mod_metadata.go @@ -13,17 +13,16 @@ import ( ) const ( - modMetadataDesc = ` - This command outputs the resolved dependencies of a package - ` + modMetadataDesc = `This command outputs the resolved dependencies of a package +` modMetadataExample = ` # Output the resolved dependencies the current module - kcl mod metadata + kcl mod metadata - # Output the resolved dependencies the current module in the vendor mode - kcl mod metadata --vendor + # Output the resolved dependencies the current module in the vendor mode + kcl mod metadata --vendor - # Output the resolved dependencies the current module with the update check - kcl mod metadata --update` + # Output the resolved dependencies the current module with the update check + kcl mod metadata --update` ) // NewModMetadataCmd returns the mod metadata command. diff --git a/cmd/kcl/commands/mod_pkg.go b/cmd/kcl/commands/mod_pkg.go index 4b52bc5..754f402 100644 --- a/cmd/kcl/commands/mod_pkg.go +++ b/cmd/kcl/commands/mod_pkg.go @@ -14,17 +14,16 @@ import ( ) const ( - modPkgDesc = ` - This command converts a kcl module into tar - ` + modPkgDesc = `This command converts a kcl module into tar +` modPkgExample = ` # Package the current module - kcl mod pkg + kcl mod pkg - # Package the current module in the vendor mode - kcl mod pkg --vendor + # Package the current module in the vendor mode + kcl mod pkg --vendor - # Package the current module into the target directory - kcl mod pkg --target /path/to/target_dir` + # Package the current module into the target directory + kcl mod pkg --target /path/to/target_dir` ) // NewModPkgCmd returns the mod pkg command. diff --git a/cmd/kcl/commands/mod_pull.go b/cmd/kcl/commands/mod_pull.go index 235c6c6..0de1182 100644 --- a/cmd/kcl/commands/mod_pull.go +++ b/cmd/kcl/commands/mod_pull.go @@ -6,11 +6,10 @@ import ( ) const ( - modPullDesc = ` - This command pulls kcl modules from the registry. - ` + modPullDesc = `This command pulls kcl modules from the registry. +` modPullExample = ` # Pull the the module named "k8s" to the local path from the registry - kcl mod pull k8s` + kcl mod pull k8s` ) // NewModPullCmd returns the mod pull command. diff --git a/cmd/kcl/commands/mod_push.go b/cmd/kcl/commands/mod_push.go index 3a42a74..e969787 100644 --- a/cmd/kcl/commands/mod_push.go +++ b/cmd/kcl/commands/mod_push.go @@ -16,14 +16,13 @@ import ( ) const ( - modPushDesc = ` - This command pushes kcl modules to the registry. - ` + modPushDesc = `This command pushes kcl modules to the registry. +` modPushExample = ` # Push the current module to the registry - kcl mod push + kcl mod push - # Push the current module to the registry in the vendor mode - kcl mod push --vendor` + # Push the current module to the registry in the vendor mode + kcl mod push --vendor` ) // NewModPushCmd returns the mod push command. diff --git a/cmd/kcl/commands/mod_update.go b/cmd/kcl/commands/mod_update.go index 8255f26..3427eec 100644 --- a/cmd/kcl/commands/mod_update.go +++ b/cmd/kcl/commands/mod_update.go @@ -11,14 +11,13 @@ import ( ) const ( - modUpdateDesc = ` - This command updates dependencies listed in kcl.mod.lock based on kcl.mod. - ` + modUpdateDesc = `This command updates dependencies listed in kcl.mod.lock based on kcl.mod. +` modUpdateExample = ` # Update the current module - kcl mod update + kcl mod update - # Update the module with the specified path - kcl mod update path/to/package` + # Update the module with the specified path + kcl mod update path/to/package` ) // NewModUpdateCmd returns the mod update command. diff --git a/cmd/kcl/commands/play.go b/cmd/kcl/commands/play.go index f6e7b3e..f9d031d 100644 --- a/cmd/kcl/commands/play.go +++ b/cmd/kcl/commands/play.go @@ -12,8 +12,7 @@ import ( ) const ( - playDesc = ` -This command opens the kcl playground in the browser. + playDesc = `This command opens the kcl playground in the browser. ` playExample = ` # Open in the localhost:80 and open the browser. kcl play --open diff --git a/cmd/kcl/commands/registry.go b/cmd/kcl/commands/registry.go index dc63880..26609b9 100644 --- a/cmd/kcl/commands/registry.go +++ b/cmd/kcl/commands/registry.go @@ -7,15 +7,13 @@ import ( ) const ( - registryDesc = ` -This command manages the kcl registry + registryDesc = `This command manages the kcl registry ` registryExample = ` # Login the registry kcl registry login docker.io # Logout the registry - kcl registry logout - ` + kcl registry logout` ) var ( diff --git a/cmd/kcl/commands/registry_login.go b/cmd/kcl/commands/registry_login.go index 15dfed3..ec95e6f 100644 --- a/cmd/kcl/commands/registry_login.go +++ b/cmd/kcl/commands/registry_login.go @@ -8,18 +8,17 @@ import ( ) const ( - registryLoginDesc = ` - This command can be used to login to a registry. - ` + registryLoginDesc = `This command can be used to login to a registry. +` registryLoginExample = ` # Login the docker hub - kcl registry login docker.io + kcl registry login docker.io - # Login the GitHub container registry - kcl registry login ghcr.io + # Login the GitHub container registry + kcl registry login ghcr.io - # Login a localhost registry - kcl registry login https://localhost:5001 - ` + # Login a localhost registry + kcl registry login https://localhost:5001 +` ) // NewRegistryLoginCmd returns the registry login command. diff --git a/cmd/kcl/commands/registry_logout.go b/cmd/kcl/commands/registry_logout.go index f929904..ae89310 100644 --- a/cmd/kcl/commands/registry_logout.go +++ b/cmd/kcl/commands/registry_logout.go @@ -7,12 +7,11 @@ import ( ) const ( - registryLogoutDesc = ` - This command can be used to logout from the current registry. - ` + registryLogoutDesc = `This command can be used to logout from the current registry. +` registryLogoutExample = ` # Logout the registry - kcl registry logout docker.io - ` + kcl registry logout docker.io +` ) // NewRegistryLogoutCmd returns the registry logout command. diff --git a/cmd/kcl/commands/run.go b/cmd/kcl/commands/run.go index b2e0a2c..a8454dd 100644 --- a/cmd/kcl/commands/run.go +++ b/cmd/kcl/commands/run.go @@ -8,8 +8,7 @@ import ( ) const ( - runDesc = ` -This command runs the kcl code and displays the output. 'kcl run' takes multiple input for arguments. + runDesc = `This command runs the kcl code and displays the output. 'kcl run' takes multiple input for arguments. For example, 'kcl run path/to/kcl.k' will run the file named path/to/kcl.k ` @@ -26,8 +25,7 @@ For example, 'kcl run path/to/kcl.k' will run the file named path/to/kcl.k kcl run oci://ghcr.io/kcl-lang/hello-world # Run the current package - kcl run - ` + kcl run` ) // NewRunCmd returns the run command. diff --git a/cmd/kcl/commands/server.go b/cmd/kcl/commands/server.go index 6cae4cc..e1de775 100644 --- a/cmd/kcl/commands/server.go +++ b/cmd/kcl/commands/server.go @@ -9,8 +9,7 @@ import ( ) const ( - 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. + 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. ` serverExample = ` # Run a kcl server kcl server @@ -22,8 +21,7 @@ This command runs a kcl server with multiple REST APIs. See https://kcl-lang.io/ curl -X POST http://127.0.0.1:2021/api:protorpc/BuiltinService.ListMethod --data '{}' # Use the Run API - curl -X POST http://127.0.0.1:2021/api:protorpc/KclvmService.ExecProgram -H "accept: application/json" --data '{"k_filename_list": ["main.k"]}' - ` + curl -X POST http://127.0.0.1:2021/api:protorpc/KclvmService.ExecProgram -H "accept: application/json" --data '{"k_filename_list": ["main.k"]}'` ) var ( diff --git a/cmd/kcl/commands/test.go b/cmd/kcl/commands/test.go index e97cc0e..9940224 100644 --- a/cmd/kcl/commands/test.go +++ b/cmd/kcl/commands/test.go @@ -12,8 +12,7 @@ import ( ) const ( - testDesc = ` -This command automates testing the packages named by the import paths. + testDesc = `This command automates testing the packages named by the import paths. 'KCL test' re-compiles each package along with any files with names matching the file pattern "*_test.k". These additional files can contain test functions @@ -29,8 +28,7 @@ that starts with "test_*". kcl test ./... --fail-fast # Test with the regex expression filter 'test_func' - kcl test ./... --run test_func - ` + kcl test ./... --run test_func` ) // NewTestCmd returns the test command. diff --git a/cmd/kcl/commands/vet.go b/cmd/kcl/commands/vet.go index c2c106f..404e05f 100644 --- a/cmd/kcl/commands/vet.go +++ b/cmd/kcl/commands/vet.go @@ -13,8 +13,7 @@ import ( ) const ( - vetDesc = ` -This command validates the data file using the kcl code. + vetDesc = `This command validates the data file using the kcl code. ` vetExample = ` # Validate the JSON data using the kcl code kcl vet data.json code.k @@ -23,8 +22,7 @@ This command validates the data file using the kcl code. kcl vet data.yaml code.k --format yaml # Validate the JSON data using the kcl code with the schema name - kcl vet data.json code.k -s Schema -` + kcl vet data.json code.k -s Schema` ) // NewVetCmd returns the vet command.