mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-23 22:19:39 +01:00
scripted-diff: stop using the gArgs wrappers
They were temporary additions to ease the transition. -BEGIN VERIFY SCRIPT- find src/ -name "*.cpp" ! -wholename "src/util.h" ! -wholename "src/util.cpp" | xargs perl -i -pe 's/(?<!\.)(ParseParameters|ReadConfigFile|IsArgSet|(Soft|Force)?(Get|Set)(|Bool|)Arg(s)?)\(/gArgs.\1(/g' -END VERIFY SCRIPT-
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
1227be30ec
commit
bb81e17355
@@ -71,14 +71,14 @@ bool AppInit(int argc, char* argv[])
|
||||
// Parameters
|
||||
//
|
||||
// If Qt is used, parameters/bitcoin.conf are parsed in qt/bitcoin.cpp's main()
|
||||
ParseParameters(argc, argv);
|
||||
gArgs.ParseParameters(argc, argv);
|
||||
|
||||
// Process help and version before taking care about datadir
|
||||
if (IsArgSet("-?") || IsArgSet("-h") || IsArgSet("-help") || IsArgSet("-version"))
|
||||
if (gArgs.IsArgSet("-?") || gArgs.IsArgSet("-h") || gArgs.IsArgSet("-help") || gArgs.IsArgSet("-version"))
|
||||
{
|
||||
std::string strUsage = strprintf(_("%s Daemon"), _(PACKAGE_NAME)) + " " + _("version") + " " + FormatFullVersion() + "\n";
|
||||
|
||||
if (IsArgSet("-version"))
|
||||
if (gArgs.IsArgSet("-version"))
|
||||
{
|
||||
strUsage += FormatParagraph(LicenseInfo());
|
||||
}
|
||||
@@ -98,12 +98,12 @@ bool AppInit(int argc, char* argv[])
|
||||
{
|
||||
if (!fs::is_directory(GetDataDir(false)))
|
||||
{
|
||||
fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", GetArg("-datadir", "").c_str());
|
||||
fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", gArgs.GetArg("-datadir", "").c_str());
|
||||
return false;
|
||||
}
|
||||
try
|
||||
{
|
||||
ReadConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME));
|
||||
gArgs.ReadConfigFile(gArgs.GetArg("-conf", BITCOIN_CONF_FILENAME));
|
||||
} catch (const std::exception& e) {
|
||||
fprintf(stderr,"Error reading configuration file: %s\n", e.what());
|
||||
return false;
|
||||
@@ -125,7 +125,7 @@ bool AppInit(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// -server defaults to true for bitcoind but not for the GUI so do this here
|
||||
SoftSetBoolArg("-server", true);
|
||||
gArgs.SoftSetBoolArg("-server", true);
|
||||
// Set this early so that parameter interactions go to console
|
||||
InitLogging();
|
||||
InitParameterInteraction();
|
||||
@@ -144,7 +144,7 @@ bool AppInit(int argc, char* argv[])
|
||||
// InitError will have been called with detailed error, which ends up on console
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (GetBoolArg("-daemon", false))
|
||||
if (gArgs.GetBoolArg("-daemon", false))
|
||||
{
|
||||
#if HAVE_DECL_DAEMON
|
||||
fprintf(stdout, "Bitcoin server starting\n");
|
||||
|
||||
Reference in New Issue
Block a user