From de81cf039087e029394f699f504e00199ab96f11 Mon Sep 17 00:00:00 2001 From: Darkhood148 Date: Sun, 16 Mar 2025 01:17:15 +0530 Subject: [PATCH] Adds hidden parameter FAQ Signed-off-by: Darkhood148 --- docs/user_docs/support/faq-kcl.md | 16 ++++++++++++++++ .../version-0.11/user_docs/support/faq-kcl.md | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/docs/user_docs/support/faq-kcl.md b/docs/user_docs/support/faq-kcl.md index 9edd41291..7091c0bdc 100644 --- a/docs/user_docs/support/faq-kcl.md +++ b/docs/user_docs/support/faq-kcl.md @@ -2703,3 +2703,19 @@ Key Differences: - Immutability: KCL emphasizes immutability, which influences how mixins and protocols are used, making them more suitable for declarative configurations. In summary, KCL's mixins and protocols combine concepts from various programming languages but are optimized for configuration management and policy definition, providing a powerful and flexible way to construct and validate complex data structures. + +## 70. How do we output fields with leading underscores? + +We can use the `--show-hidden` or `-H` flag when use the KCL CLI to run KCL files. e.g.: + +main.k +```python +a = 1 +_b = 2 +``` + +The output maybe as follows with the command `kcl run main.k -H` +```yaml +a: 1 +_b: 2 +``` diff --git a/versioned_docs/version-0.11/user_docs/support/faq-kcl.md b/versioned_docs/version-0.11/user_docs/support/faq-kcl.md index 9edd41291..7091c0bdc 100644 --- a/versioned_docs/version-0.11/user_docs/support/faq-kcl.md +++ b/versioned_docs/version-0.11/user_docs/support/faq-kcl.md @@ -2703,3 +2703,19 @@ Key Differences: - Immutability: KCL emphasizes immutability, which influences how mixins and protocols are used, making them more suitable for declarative configurations. In summary, KCL's mixins and protocols combine concepts from various programming languages but are optimized for configuration management and policy definition, providing a powerful and flexible way to construct and validate complex data structures. + +## 70. How do we output fields with leading underscores? + +We can use the `--show-hidden` or `-H` flag when use the KCL CLI to run KCL files. e.g.: + +main.k +```python +a = 1 +_b = 2 +``` + +The output maybe as follows with the command `kcl run main.k -H` +```yaml +a: 1 +_b: 2 +```