@@ -54,22 +54,19 @@ static bool AppInit(int argc, char* argv[])
54
54
SetupServerArgs (node);
55
55
ArgsManager& args = *Assert (node.args );
56
56
std::string error;
57
- if (!gArgs .ParseParameters (argc, argv, error)) {
57
+ if (!args .ParseParameters (argc, argv, error)) {
58
58
return InitError (Untranslated (strprintf (" Error parsing command line arguments: %s\n " , error)));
59
59
}
60
60
61
61
// Process help and version before taking care about datadir
62
- if (HelpRequested (gArgs ) || gArgs .IsArgSet (" -version" )) {
62
+ if (HelpRequested (args ) || args .IsArgSet (" -version" )) {
63
63
std::string strUsage = PACKAGE_NAME " version " + FormatFullVersion () + " \n " ;
64
64
65
- if (gArgs .IsArgSet (" -version" ))
66
- {
65
+ if (args.IsArgSet (" -version" )) {
67
66
strUsage += FormatParagraph (LicenseInfo ()) + " \n " ;
68
- }
69
- else
70
- {
67
+ } else {
71
68
strUsage += " \n Usage: bitcoind [options] Start " PACKAGE_NAME " \n " ;
72
- strUsage += " \n " + gArgs .GetHelpMessage ();
69
+ strUsage += " \n " + args .GetHelpMessage ();
73
70
}
74
71
75
72
tfm::format (std::cout, " %s" , strUsage);
@@ -80,14 +77,14 @@ static bool AppInit(int argc, char* argv[])
80
77
try
81
78
{
82
79
if (!CheckDataDirOption ()) {
83
- return InitError (Untranslated (strprintf (" Specified data directory \" %s\" does not exist.\n " , gArgs .GetArg (" -datadir" , " " ))));
80
+ return InitError (Untranslated (strprintf (" Specified data directory \" %s\" does not exist.\n " , args .GetArg (" -datadir" , " " ))));
84
81
}
85
- if (!gArgs .ReadConfigFiles (error, true )) {
82
+ if (!args .ReadConfigFiles (error, true )) {
86
83
return InitError (Untranslated (strprintf (" Error reading configuration file: %s\n " , error)));
87
84
}
88
85
// Check for -chain, -testnet or -regtest parameter (Params() calls are only valid after this clause)
89
86
try {
90
- SelectParams (gArgs .GetChainName ());
87
+ SelectParams (args .GetChainName ());
91
88
} catch (const std::exception& e) {
92
89
return InitError (Untranslated (strprintf (" %s\n " , e.what ())));
93
90
}
@@ -99,13 +96,13 @@ static bool AppInit(int argc, char* argv[])
99
96
}
100
97
}
101
98
102
- if (!gArgs .InitSettings (error)) {
99
+ if (!args .InitSettings (error)) {
103
100
InitError (Untranslated (error));
104
101
return false ;
105
102
}
106
103
107
104
// -server defaults to true for bitcoind but not for the GUI so do this here
108
- gArgs .SoftSetBoolArg (" -server" , true );
105
+ args .SoftSetBoolArg (" -server" , true );
109
106
// Set this early so that parameter interactions go to console
110
107
InitLogging (args);
111
108
InitParameterInteraction (args);
@@ -122,8 +119,7 @@ static bool AppInit(int argc, char* argv[])
122
119
// InitError will have been called with detailed error, which ends up on console
123
120
return false ;
124
121
}
125
- if (gArgs .GetBoolArg (" -daemon" , false ))
126
- {
122
+ if (args.GetBoolArg (" -daemon" , false )) {
127
123
#if HAVE_DECL_DAEMON
128
124
#if defined(MAC_OSX)
129
125
#pragma GCC diagnostic push
0 commit comments