r-Techsupport / hyde

A web editor and CMS for Jekyll/git static sites.
GNU General Public License v3.0
3 stars 2 forks source link

Every config option should be settable via the command line #55

Closed zleyyij closed 2 weeks ago

zleyyij commented 2 weeks ago

Clap should make this easier, I suppose you could have the process set its own environment variables from the CLI options if you still wanted everything as an environment variable, without a global config struct or something like that.

zleyyij commented 2 weeks ago

https://github.com/clap-rs/clap_derive/blob/master/examples/keyvalue.rs

This should be easy, just have a vec of key value pairs, iterate over all of them and set them as env vars on startup

zleyyij commented 2 weeks ago

Completed as of 2a2c7c39b25d0c7a96ba1d9abe89974f69bb2d24, you can now set config options by passing --cfg/-c, and a comma delimited list of settings, or multiple occurrences of the --cfg/-c flag.

Example:

hyde --cfg OPT_1=himom,OPT_2=hello

hyde -c OPT_1=himom -c OPT_2=hello