Commandline parameters override array configuration options from file #1318
-
Hey folks, Background informationfeature: remap My lychee use case relies on testing multiple products documentation. I am using multiple re-mappings as products locally cannot be stored in a single folder. So I am remapping from https urls product A to folder file:///A, product B to file:///B etc. Using the base parameter does not work for me. I am storing my configuration in my Other idea which could potentially sort my problem in a direct way and keep all the configs in one place - which is preferred - if lychee could expand environment/template configurations in the Questions
SummaryPlease share your thoughts, appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Heyo @askalski85, I understand your use-case. Regarding 1: what if a user wants to indeed completely overwrite a setting through the command line? E.g. what if the Regarding 2: Environment variable substitution in TOML itself was ruled out in 2014 (toml-lang/toml#255) and again in 2017 (toml-lang/toml#496). The next option would be the toml crate itself, which we use for parsing the config file. I think the easiest would be to substitute the variables yourself with something like # 1. Make sure the environment variables are set first
# 2. Create a lychee.toml.tmpl with the env vars
# 3. To render the lychee config, call
envsubst < lychee.toml.tmpl > lychee.toml So this could be a workaround for 2. Maybe that works for you? Thanks. 😊 |
Beta Was this translation helpful? Give feedback.
Heyo @askalski85,
I understand your use-case.
Regarding 1: what if a user wants to indeed completely overwrite a setting through the command line? E.g. what if the
--remap
s I set on the command line should be the only valid ones? In this case, I would have to remember what the overwrite rules are and which variables get overwritten and which ones don't. 😕 It gets complicated pretty quickly.Regarding 2:
Environment variable substitution in TOML itself was ruled out in 2014 (toml-lang/toml#255) and again in 2017 (toml-lang/toml#496).
The next option would be the toml crate itself, which we use for parsing the config file.
It is not supported there, either. Probably because it's outside the…