Skip to content

Commit fa9d590

Browse files
author
MarcoFalke
committed
scripted-diff: gArgs -> args
-BEGIN VERIFY SCRIPT- # Replace gArgs with args sed -i 's/\<gArgs\>/args/g' src/init.cpp src/bitcoind.cpp sed -i 's/&args;/\&gArgs;/g' src/init.cpp # Format changed lines git diff -U0 | clang-format-diff -p1 -i -v -END VERIFY SCRIPT-
1 parent fa33bc2 commit fa9d590

File tree

2 files changed

+140
-148
lines changed

2 files changed

+140
-148
lines changed

src/bitcoind.cpp

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,19 @@ static bool AppInit(int argc, char* argv[])
5454
SetupServerArgs(node);
5555
ArgsManager& args = *Assert(node.args);
5656
std::string error;
57-
if (!gArgs.ParseParameters(argc, argv, error)) {
57+
if (!args.ParseParameters(argc, argv, error)) {
5858
return InitError(Untranslated(strprintf("Error parsing command line arguments: %s\n", error)));
5959
}
6060

6161
// Process help and version before taking care about datadir
62-
if (HelpRequested(gArgs) || gArgs.IsArgSet("-version")) {
62+
if (HelpRequested(args) || args.IsArgSet("-version")) {
6363
std::string strUsage = PACKAGE_NAME " version " + FormatFullVersion() + "\n";
6464

65-
if (gArgs.IsArgSet("-version"))
66-
{
65+
if (args.IsArgSet("-version")) {
6766
strUsage += FormatParagraph(LicenseInfo()) + "\n";
68-
}
69-
else
70-
{
67+
} else {
7168
strUsage += "\nUsage: bitcoind [options] Start " PACKAGE_NAME "\n";
72-
strUsage += "\n" + gArgs.GetHelpMessage();
69+
strUsage += "\n" + args.GetHelpMessage();
7370
}
7471

7572
tfm::format(std::cout, "%s", strUsage);
@@ -80,14 +77,14 @@ static bool AppInit(int argc, char* argv[])
8077
try
8178
{
8279
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", ""))));
8481
}
85-
if (!gArgs.ReadConfigFiles(error, true)) {
82+
if (!args.ReadConfigFiles(error, true)) {
8683
return InitError(Untranslated(strprintf("Error reading configuration file: %s\n", error)));
8784
}
8885
// Check for -chain, -testnet or -regtest parameter (Params() calls are only valid after this clause)
8986
try {
90-
SelectParams(gArgs.GetChainName());
87+
SelectParams(args.GetChainName());
9188
} catch (const std::exception& e) {
9289
return InitError(Untranslated(strprintf("%s\n", e.what())));
9390
}
@@ -99,13 +96,13 @@ static bool AppInit(int argc, char* argv[])
9996
}
10097
}
10198

102-
if (!gArgs.InitSettings(error)) {
99+
if (!args.InitSettings(error)) {
103100
InitError(Untranslated(error));
104101
return false;
105102
}
106103

107104
// -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);
109106
// Set this early so that parameter interactions go to console
110107
InitLogging(args);
111108
InitParameterInteraction(args);
@@ -122,8 +119,7 @@ static bool AppInit(int argc, char* argv[])
122119
// InitError will have been called with detailed error, which ends up on console
123120
return false;
124121
}
125-
if (gArgs.GetBoolArg("-daemon", false))
126-
{
122+
if (args.GetBoolArg("-daemon", false)) {
127123
#if HAVE_DECL_DAEMON
128124
#if defined(MAC_OSX)
129125
#pragma GCC diagnostic push

0 commit comments

Comments
 (0)