summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2020-09-23 23:54:01 +0200
committerlouiz’ <louiz@louiz.org>2020-09-23 23:55:50 +0200
commit5607c101d4b28244bde85bedfb9ab22b882309fc (patch)
tree0e6803e4272017c667b4184677aa81b74159836e
parent0bb4f144fcded6b5753b5de7493b7b10474c9a1f (diff)
downloadbiboumi-5607c101d4b28244bde85bedfb9ab22b882309fc.tar.gz
biboumi-5607c101d4b28244bde85bedfb9ab22b882309fc.tar.bz2
biboumi-5607c101d4b28244bde85bedfb9ab22b882309fc.tar.xz
biboumi-5607c101d4b28244bde85bedfb9ab22b882309fc.zip
Little code simplification for conf_filename
-rw-r--r--src/main.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 21d0df8..20bf9fd 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -194,7 +194,7 @@ static int main_loop(std::string hostname, std::string password)
int main(int ac, char** av)
{
- std::string cli_conf_filename;
+ std::string conf_filename{};
bool test_conf = false;
if (ac > 1)
{
@@ -206,7 +206,7 @@ int main(int ac, char** av)
else if ((arg == "-t") || (arg == "--test-config"))
test_conf = true;
else if (i + 1 == ac)
- cli_conf_filename = arg;
+ conf_filename = arg;
else
{
std::cerr << "Unknow command line option: " << arg
@@ -215,8 +215,8 @@ int main(int ac, char** av)
}
}
}
- const std::string conf_filename =
- cli_conf_filename.empty() ? xdg_config_path("biboumi.cfg"): cli_conf_filename;
+ if (conf_filename.empty())
+ conf_filename = xdg_config_path("biboumi.cfg");
std::cout << "Using configuration file: " << conf_filename << std::endl;
if (!Config::read_conf(conf_filename))