I am building a command line application. Part of the application relies on a configuration file. The intended behaviour is to have this configuration file as a dotfile in the users home directory. The configuration files are written using TOML.
The cli ui has a -c/--config
option that the user can use to provide the path to an alternate configuration file.
If the -c
parameter is used the application must read the provided config file and parse it otherwise it will fall back to ~/.application.toml
The configuration file is parsed and a Config
struct is built that maps the values in the config to fields on the struct. At the moment, there is only one param in the config file: data_path
. so the Struct is very simple.