mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 23:09:44 -04:00
Cleanup -includeconf error message
Remove the erroneous trailing newline '\n'. Also, print only the first value to remove needless redundancy in the error message.
This commit is contained in:
parent
fa9f711c37
commit
fad0867d6a
2 changed files with 5 additions and 7 deletions
|
@ -366,14 +366,12 @@ bool ArgsManager::ParseParameters(int argc, const char* const argv[], std::strin
|
||||||
}
|
}
|
||||||
|
|
||||||
// we do not allow -includeconf from command line
|
// we do not allow -includeconf from command line
|
||||||
bool success = true;
|
|
||||||
if (auto* includes = util::FindKey(m_settings.command_line_options, "includeconf")) {
|
if (auto* includes = util::FindKey(m_settings.command_line_options, "includeconf")) {
|
||||||
for (const auto& include : util::SettingsSpan(*includes)) {
|
const auto& include{*util::SettingsSpan(*includes).begin()}; // pick first value as example
|
||||||
error += "-includeconf cannot be used from commandline; -includeconf=" + include.write() + "\n";
|
error = "-includeconf cannot be used from commandline; -includeconf=" + include.write();
|
||||||
success = false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
return true;
|
||||||
return success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<unsigned int> ArgsManager::GetArgFlags(const std::string& name) const
|
std::optional<unsigned int> ArgsManager::GetArgFlags(const std::string& name) const
|
||||||
|
|
|
@ -47,7 +47,7 @@ class IncludeConfTest(BitcoinTestFramework):
|
||||||
expected_msg='Error: Error parsing command line arguments: -includeconf cannot be used from commandline; -includeconf=true',
|
expected_msg='Error: Error parsing command line arguments: -includeconf cannot be used from commandline; -includeconf=true',
|
||||||
)
|
)
|
||||||
self.nodes[0].assert_start_raises_init_error(
|
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"',
|
expected_msg='Error: Error parsing command line arguments: -includeconf cannot be used from commandline; -includeconf="relative2.conf"',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue