From f678b7544409524393252150909619e59eaa5bd6 Mon Sep 17 00:00:00 2001 From: Louis Westerheide Date: Fri, 17 Apr 2026 14:54:55 +0200 Subject: [PATCH 1/5] add configuration resolution order section --- .../configuration/index.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/automate/cmemc-command-line-interface/configuration/index.md b/docs/automate/cmemc-command-line-interface/configuration/index.md index 8dce0e91..702bfa6d 100644 --- a/docs/automate/cmemc-command-line-interface/configuration/index.md +++ b/docs/automate/cmemc-command-line-interface/configuration/index.md @@ -38,3 +38,18 @@ In order to work with cmemc, you have to configure it according to your needs. In addition to that, cmemc can work with [custom certificates](certificate-handling-and-ssl-verification/index.md). + +## Configuration value resolution order + +When the same key is defined in multiple places, cmemc resolves values in the following order: + +1. **Named connection section** — When you run cmemc with a specific connection (e.g. `-c my-connection`), +all keys from the corresponding `[my-connection]` section are used. This takes full precedence, +including over OS environment variables, so you can define self-contained, reproducible +connection profiles that are not affected by your shell environment. + +2. **OS environment variables** — If a key is set as an environment variable and no named connection +section is active, the environment variable value is used. + +3. **`[DEFAULT]` section** — The `[DEFAULT]` section in `~/.config/cmemc/cmemc.ini` acts as a fallback +for all connections. Its values are ignored if the same key is already set as an environment variable. From dddb5ea3843dc9dbb49b71283d3000202107e773 Mon Sep 17 00:00:00 2001 From: Louis Westerheide Date: Mon, 20 Apr 2026 14:48:41 +0200 Subject: [PATCH 2/5] add fallback section to documentation --- .../cmemc-command-line-interface/configuration/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/automate/cmemc-command-line-interface/configuration/index.md b/docs/automate/cmemc-command-line-interface/configuration/index.md index 702bfa6d..2ec2a1de 100644 --- a/docs/automate/cmemc-command-line-interface/configuration/index.md +++ b/docs/automate/cmemc-command-line-interface/configuration/index.md @@ -53,3 +53,5 @@ section is active, the environment variable value is used. 3. **`[DEFAULT]` section** — The `[DEFAULT]` section in `~/.config/cmemc/cmemc.ini` acts as a fallback for all connections. Its values are ignored if the same key is already set as an environment variable. +Keys present in the `[DEFAULT]` section but absent from the named connection section still +apply as a fallback. From 264b76e992959bbf5a5ec3c5d3f0ccb887ac8c84 Mon Sep 17 00:00:00 2001 From: Louis Westerheide Date: Mon, 20 Apr 2026 14:56:40 +0200 Subject: [PATCH 3/5] fix linter issue --- .../cmemc-command-line-interface/configuration/index.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/automate/cmemc-command-line-interface/configuration/index.md b/docs/automate/cmemc-command-line-interface/configuration/index.md index 2ec2a1de..daa57adb 100644 --- a/docs/automate/cmemc-command-line-interface/configuration/index.md +++ b/docs/automate/cmemc-command-line-interface/configuration/index.md @@ -53,5 +53,4 @@ section is active, the environment variable value is used. 3. **`[DEFAULT]` section** — The `[DEFAULT]` section in `~/.config/cmemc/cmemc.ini` acts as a fallback for all connections. Its values are ignored if the same key is already set as an environment variable. -Keys present in the `[DEFAULT]` section but absent from the named connection section still -apply as a fallback. +Keys present in the `[DEFAULT]` section but absent from the named connection section still apply as a fallback. From ff5c41a5cb0868fbfab85dde6455dcb73745ae07 Mon Sep 17 00:00:00 2001 From: Sebastian Tramp Date: Mon, 20 Apr 2026 15:01:17 +0200 Subject: [PATCH 4/5] add link --- .../cmemc-command-line-interface/configuration/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/automate/cmemc-command-line-interface/configuration/index.md b/docs/automate/cmemc-command-line-interface/configuration/index.md index daa57adb..a4f5cdae 100644 --- a/docs/automate/cmemc-command-line-interface/configuration/index.md +++ b/docs/automate/cmemc-command-line-interface/configuration/index.md @@ -48,9 +48,9 @@ all keys from the corresponding `[my-connection]` section are used. This takes f including over OS environment variables, so you can define self-contained, reproducible connection profiles that are not affected by your shell environment. -2. **OS environment variables** — If a key is set as an environment variable and no named connection +2. **Environment variables** — If a key is set as an environment variable and no named connection section is active, the environment variable value is used. -3. **`[DEFAULT]` section** — The `[DEFAULT]` section in `~/.config/cmemc/cmemc.ini` acts as a fallback +3. **`[DEFAULT]` section** — The `[DEFAULT]` section in [`cmemc.ini`](file-based-configuration/index.md) acts as a fallback for all connections. Its values are ignored if the same key is already set as an environment variable. Keys present in the `[DEFAULT]` section but absent from the named connection section still apply as a fallback. From 9262dcc7799851ad73347c4043afbdb16fdc4939 Mon Sep 17 00:00:00 2001 From: Sebastian Tramp Date: Mon, 20 Apr 2026 15:13:04 +0200 Subject: [PATCH 5/5] use info section --- .../configuration/index.md | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/docs/automate/cmemc-command-line-interface/configuration/index.md b/docs/automate/cmemc-command-line-interface/configuration/index.md index a4f5cdae..b970051f 100644 --- a/docs/automate/cmemc-command-line-interface/configuration/index.md +++ b/docs/automate/cmemc-command-line-interface/configuration/index.md @@ -39,18 +39,16 @@ In order to work with cmemc, you have to configure it according to your needs. -## Configuration value resolution order +!!! info "Configuration value resolution order" -When the same key is defined in multiple places, cmemc resolves values in the following order: + When the same key is defined in multiple places, cmemc resolves values in the following order: -1. **Named connection section** — When you run cmemc with a specific connection (e.g. `-c my-connection`), -all keys from the corresponding `[my-connection]` section are used. This takes full precedence, -including over OS environment variables, so you can define self-contained, reproducible -connection profiles that are not affected by your shell environment. + 1. **Named connection section** — When you run cmemc with a specific connection (e.g. `-c my-connection`), all keys from the corresponding `[my-connection]` section are used. + This takes full precedence, including over OS environment variables, so you can define self-contained, reproducible connection profiles that are not affected by your shell environment. -2. **Environment variables** — If a key is set as an environment variable and no named connection -section is active, the environment variable value is used. + 2. **Environment variables** — If a key is set as an [environment variable](environment-based-configuration/index.md) and no named connection section is active, the environment variable value is used. + + 3. **`[DEFAULT]` section** — The `[DEFAULT]` section in [`cmemc.ini`](file-based-configuration/index.md) acts as a fallback for all connections. + Its values are ignored if the same key is already set as an environment variable. + Keys present in the `[DEFAULT]` section but absent from the named connection section still apply as a fallback. -3. **`[DEFAULT]` section** — The `[DEFAULT]` section in [`cmemc.ini`](file-based-configuration/index.md) acts as a fallback -for all connections. Its values are ignored if the same key is already set as an environment variable. -Keys present in the `[DEFAULT]` section but absent from the named connection section still apply as a fallback.