Skip to content

Commit 4844ac4

Browse files
authored
Merge pull request #224 from eccenca/feature/addCMEMCinitAndEnvironmentInfo-CMEM-7559
add configuration resolution order section
2 parents cea6c05 + 53b8086 commit 4844ac4

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

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

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,19 @@ 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+
!!! info "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`), all keys from the corresponding `[my-connection]` section are used.
47+
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.
48+
49+
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.
50+
51+
3. **`[DEFAULT]` section** — The `[DEFAULT]` section in [`cmemc.ini`](file-based-configuration/index.md) acts as a fallback for all connections.
52+
Its values are ignored if the same key is already set as an environment variable.
53+
Keys present in the `[DEFAULT]` section but absent from the named connection section still apply as a fallback.
54+
55+
4. **Command specific environment variables** — Command-specific variables (e.g. `CMEMC_GRAPH_LIST_ID_ONLY`) are never overridden or cleared when switching connections.
56+
They apply regardless of whether -c is active, from either the config file or the environment.

0 commit comments

Comments
 (0)