Open smithfarm opened 8 years ago
Ah! It already scans for /etc/dochazka-cli
and $HOME/.dochazka-cli
but it's "either, or" - not both.
App::MREST::CLI/init_cli_client currently takes only a single sitedir parameter. It needs to take a list of sitedirs, and it shouldn't care if they do or don't exist.
Then, modify dochazka-cli
script to pass "/etc/dochazka-cli" and "$HOME/.dochazka-cli" without checking if they exist or not.
actually I disagree, I prefer the current workflow. If ~/.dochazka-cli
exists, load it. If it doesn't, if /etc/dochazka-cli
exists load it. Else ERROR: no config found
. This is how usually cli tools work
The inspiration for this is, e.g., bash. When started, bash first loads the system bashrc, then the user bashrc.
If there is a possibility to have a system-wide configuration directory and a user configuration directory, then they should both be scanned IMO.
Imagine the following scenario: all employees run dochazka-cli from a single machine where they each have an account. The admin of that machine can set certain parameters globally in /etc/dochazka-cli
yet users still have the ability to set other parameters individually in ~/.dochazka-cli
.
In our case, each employee will run dochazka-cli from his own machine, but if both directories are scanned the packager has the option of overriding default config param values in /etc/dochazka-cli
.
the idea of having a global /etc/dochazka-cli for many users is valid, but the issue can be solved with the environment variables I proposed in https://github.com/smithfarm/dochazka/issues/6
I am not going to hardcode any vars in the config in the package ftr, I am going to use configuration management to handle that file in production
In CLI, each user needs to be able to tweak his or her own configuration, so
dochazka-cli
needs to not only scan the system-wide configuration directory (/etc/dochazka-cli
) but also the user's own local configuration directory ($HOME/.dochazka-cli
).Implementation of this feature should include documentation changes in CLI_Config.pm and ext/CLI_SiteConfig.pm.