catay / rrst

Remote Repository Sync Tool
Apache License 2.0
5 stars 1 forks source link

Enhance the lookup order of the configuration file. #22

Closed catay closed 4 years ago

catay commented 4 years ago

In the current implementation the default config location is /etc/rrst.yaml. This can be changed through the -c option on the command line.

This should be enhanced with a proper lookup order which is more in line with the standard behaviour of Linux tools.

The lookup order of the configuration file should be:

  1. value provided as argument on the command line with the -c option
  2. value set as environment variable RRST_CONFIG_FILE
  3. default local location ${HOME}/.rrst/config.yaml
  4. default global location /etc/rrst/config.yaml
catay commented 4 years ago

After looking more into the above I come to the conclusion it doesn't make sense. Let's stick to a default config file location at /etc/rrst/config.yaml. If someone requires a different location , use the -coption.