From b3429370721bf35448e30ad55a77eef2419c75df Mon Sep 17 00:00:00 2001 From: Eduard Tykhoniuk Date: Tue, 24 Sep 2024 13:35:45 +0200 Subject: [PATCH] feat: return an error if multiple config files are provided --- src/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index a62a60e..71dbd1f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,6 +21,11 @@ int main(int argc, char** argv, char** envp) { return 1; } + if (!configPath.empty()) { + Debug::log(NONE, "Multiple config files are provided."); + return 1; + } + configPath = argv[++i]; if (configPath[0] == '-') { // Should be fine, because of the null terminator Debug::log(NONE, "After " + arg + " you should provide a path to a config file.");