mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
args: Catch directories in place of config files
Previously passing a directory path as -conf would lead to an ifstream being opened for it, and would not trigger any errors.
This commit is contained in:
parent
e4b6b1822c
commit
e85abe92c7
2 changed files with 13 additions and 1 deletions
|
|
@ -125,6 +125,8 @@ bool StartLogging(const ArgsManager& args)
|
|||
fs::path config_file_path = args.GetConfigFilePath();
|
||||
if (args.IsArgNegated("-conf")) {
|
||||
LogInfo("Config file: <disabled>");
|
||||
} else if (fs::is_directory(config_file_path)) {
|
||||
LogWarning("Config file: %s (is directory, not file)", fs::PathToString(config_file_path));
|
||||
} else if (fs::exists(config_file_path)) {
|
||||
LogPrintf("Config file: %s\n", fs::PathToString(config_file_path));
|
||||
} else if (args.IsArgSet("-conf")) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue