Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoind.cpp
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | bool AppInit(int argc, char *argv[]) { | ||||
bool fRet = false; | bool fRet = false; | ||||
// | // | ||||
// Parameters | // Parameters | ||||
// | // | ||||
// If Qt is used, parameters/bitcoin.conf are parsed in qt/bitcoin.cpp's | // If Qt is used, parameters/bitcoin.conf are parsed in qt/bitcoin.cpp's | ||||
// main() | // main() | ||||
SetupServerArgs(); | |||||
#if HAVE_DECL_DAEMON | |||||
gArgs.AddArg("-daemon", | |||||
_("Run in the background as a daemon and accept commands"), | |||||
false, OptionsCategory::OPTIONS); | |||||
#endif | |||||
gArgs.ParseParameters(argc, argv); | gArgs.ParseParameters(argc, argv); | ||||
// Process help and version before taking care about datadir | // Process help and version before taking care about datadir | ||||
if (HelpRequested(gArgs) || gArgs.IsArgSet("-version")) { | if (HelpRequested(gArgs) || gArgs.IsArgSet("-version")) { | ||||
std::string strUsage = | std::string strUsage = | ||||
PACKAGE_NAME " Daemon version " + FormatFullVersion() + "\n"; | PACKAGE_NAME " Daemon version " + FormatFullVersion() + "\n"; | ||||
if (gArgs.IsArgSet("-version")) { | if (gArgs.IsArgSet("-version")) { | ||||
strUsage += FormatParagraph(LicenseInfo()); | strUsage += FormatParagraph(LicenseInfo()); | ||||
} else { | } else { | ||||
strUsage += "\nUsage: bitcoind [options] " | strUsage += "\nUsage: bitcoind [options] " | ||||
"Start " PACKAGE_NAME " Daemon\n"; | "Start " PACKAGE_NAME " Daemon\n"; | ||||
strUsage += "\n" + HelpMessage(HelpMessageMode::BITCOIND); | strUsage += "\n" + gArgs.GetHelpMessage(); | ||||
} | } | ||||
fprintf(stdout, "%s", strUsage.c_str()); | fprintf(stdout, "%s", strUsage.c_str()); | ||||
return true; | return true; | ||||
} | } | ||||
try { | try { | ||||
if (!fs::is_directory(GetDataDir(false))) { | if (!fs::is_directory(GetDataDir(false))) { | ||||
▲ Show 20 Lines • Show All 109 Lines • Show Last 20 Lines |