Skip to content

Commit f678b75

Browse files
add configuration resolution order section
1 parent 95fff72 commit f678b75

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

  • docs/automate/cmemc-command-line-interface/configuration

docs/automate/cmemc-command-line-interface/configuration/index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,18 @@ In order to work with cmemc, you have to configure it according to your needs.
3838
In addition to that, cmemc can work with [custom certificates](certificate-handling-and-ssl-verification/index.md).
3939

4040
</div>
41+
42+
## Configuration value resolution order
43+
44+
When the same key is defined in multiple places, cmemc resolves values in the following order:
45+
46+
1. **Named connection section** — When you run cmemc with a specific connection (e.g. `-c my-connection`),
47+
all keys from the corresponding `[my-connection]` section are used. This takes full precedence,
48+
including over OS environment variables, so you can define self-contained, reproducible
49+
connection profiles that are not affected by your shell environment.
50+
51+
2. **OS environment variables** — If a key is set as an environment variable and no named connection
52+
section is active, the environment variable value is used.
53+
54+
3. **`[DEFAULT]` section** — The `[DEFAULT]` section in `~/.config/cmemc/cmemc.ini` acts as a fallback
55+
for all connections. Its values are ignored if the same key is already set as an environment variable.

0 commit comments

Comments
 (0)