mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 07:39:08 +01:00
init: add exe name to bitcoind, bitcoin-node -version output to be able to distinguish these in tests
This commit is contained in:
@@ -132,11 +132,16 @@ static bool ParseArgs(NodeContext& node, int argc, char* argv[])
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool ProcessInitCommands(ArgsManager& args)
|
||||
static bool ProcessInitCommands(interfaces::Init& init, ArgsManager& args)
|
||||
{
|
||||
// Process help and version before taking care about datadir
|
||||
if (HelpRequested(args) || args.GetBoolArg("-version", false)) {
|
||||
std::string strUsage = CLIENT_NAME " daemon version " + FormatFullVersion() + "\n";
|
||||
std::string strUsage = CLIENT_NAME " daemon version " + FormatFullVersion();
|
||||
if (const char* exe_name{init.exeName()}) {
|
||||
strUsage += " ";
|
||||
strUsage += exe_name;
|
||||
}
|
||||
strUsage += "\n";
|
||||
|
||||
if (args.GetBoolArg("-version", false)) {
|
||||
strUsage += FormatParagraph(LicenseInfo());
|
||||
@@ -277,7 +282,7 @@ MAIN_FUNCTION
|
||||
ArgsManager& args = *Assert(node.args);
|
||||
if (!ParseArgs(node, argc, argv)) return EXIT_FAILURE;
|
||||
// Process early info return commands such as -help or -version
|
||||
if (ProcessInitCommands(args)) return EXIT_SUCCESS;
|
||||
if (ProcessInitCommands(*init, args)) return EXIT_SUCCESS;
|
||||
|
||||
// Start application
|
||||
if (!AppInit(node) || !Assert(node.shutdown_signal)->wait()) {
|
||||
|
||||
Reference in New Issue
Block a user