aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-05-20 13:46:15 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-05-21 10:54:12 +0200
commitfad0867d6ab9430070aa7d60bf7617a6508e0586 (patch)
tree127d0af3070e2ff91c1369450868c5dce712a6e1
parentfa9f711c3746ca3962f15224285a453744cd45b3 (diff)
Cleanup -includeconf error message
Remove the erroneous trailing newline '\n'. Also, print only the first value to remove needless redundancy in the error message.
-rw-r--r--src/util/system.cpp10
-rwxr-xr-xtest/functional/feature_includeconf.py2
2 files changed, 5 insertions, 7 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp
index 00cbca1c36..76d63074e4 100644
--- a/src/util/system.cpp
+++ b/src/util/system.cpp
@@ -366,14 +366,12 @@ bool ArgsManager::ParseParameters(int argc, const char* const argv[], std::strin
}
// we do not allow -includeconf from command line
- bool success = true;
if (auto* includes = util::FindKey(m_settings.command_line_options, "includeconf")) {
- for (const auto& include : util::SettingsSpan(*includes)) {
- error += "-includeconf cannot be used from commandline; -includeconf=" + include.write() + "\n";
- success = false;
- }
+ const auto& include{*util::SettingsSpan(*includes).begin()}; // pick first value as example
+ error = "-includeconf cannot be used from commandline; -includeconf=" + include.write();
+ return false;
}
- return success;
+ return true;
}
std::optional<unsigned int> ArgsManager::GetArgFlags(const std::string& name) const
diff --git a/test/functional/feature_includeconf.py b/test/functional/feature_includeconf.py
index 061d90c446..448182eded 100755
--- a/test/functional/feature_includeconf.py
+++ b/test/functional/feature_includeconf.py
@@ -47,7 +47,7 @@ class IncludeConfTest(BitcoinTestFramework):
expected_msg='Error: Error parsing command line arguments: -includeconf cannot be used from commandline; -includeconf=true',
)
self.nodes[0].assert_start_raises_init_error(
- extra_args=['-includeconf=relative2.conf'],
+ extra_args=['-includeconf=relative2.conf', '-includeconf=no_warn.conf'],
expected_msg='Error: Error parsing command line arguments: -includeconf cannot be used from commandline; -includeconf="relative2.conf"',
)