ironarachne / world

This is a fantasy world generation CLI and set of Go packages for the same.
MIT License
48 stars 9 forks source link

Add the ability to specify configuration via file #40

Closed BenOvermyer closed 1 year ago

BenOvermyer commented 1 year ago

Currently, configuration is specified with four environment variables. Add a flag -c/--config to specify a config file instead. The config file should use the YAML format, and accept arguments like this:

data_dir: /my/directory
save_dir: /my/other/directory
save_target: filesystem
web_domain: www.example.com

The equivalent environment variables are as follows:

data_dir: WORLD_DATA_DIR save_dir: WORLD_SAVE_DIR save_target: WORLD_SAVE_TARGET web_domain: WORLD_WEB_DOMAIN

If both the environment variables and configuration file are specified, the configuration file values should override the environment variables.