I hope this is not a flame or offtopic question. In the console application (no matter what is written, for specificity, let it be Java, but this is not critical), it is possible to pass parameters in the following ways:
- command line parameter values (-f value1)
- values in the configuration file (xml, ini, yml, properties files, etc.)
- environment variable values ($ F_PARAM_VALUE = value1)
The question is: in what order should the application handle these values? Are there any recommendations, best practices, etc.?
For example, if the value is specified both in the configuration file, and in the parameters of environment variables, and in the parameters of the application itself, which value should be used?
Logically, the command line parameters should be the strongest?
путь к файлу конфига", и значение этого параметра - путь к несуществующему / неправильному файлуjust swear and exit the application. - KoVadim