Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoin-cli.cpp
| Show All 34 Lines | std::string HelpMessageCli() { | ||||
| const auto testnetBaseParams = | const auto testnetBaseParams = | ||||
| CreateBaseChainParams(CBaseChainParams::TESTNET); | CreateBaseChainParams(CBaseChainParams::TESTNET); | ||||
| std::string strUsage; | std::string strUsage; | ||||
| strUsage += HelpMessageGroup(_("Options:")); | strUsage += HelpMessageGroup(_("Options:")); | ||||
| strUsage += HelpMessageOpt("-?", _("This help message")); | strUsage += HelpMessageOpt("-?", _("This help message")); | ||||
| strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
| "-conf=<file>", strprintf(_("Specify configuration file (default: %s)"), | "-conf=<file>", strprintf(_("Specify configuration file (default: %s)"), | ||||
| BITCOIN_CONF_FILENAME)); | BITCOIN_CONF_FILENAME)); | ||||
| strUsage += HelpMessageOpt("-datadir=<dir>", _("Specify data directory")); | strUsage += gArgs.DataDirHelp(); | ||||
| AppendParamsHelpMessages(strUsage); | AppendParamsHelpMessages(strUsage); | ||||
| strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
| "-named", | "-named", | ||||
| strprintf(_("Pass named instead of positional arguments (default: %s)"), | strprintf(_("Pass named instead of positional arguments (default: %s)"), | ||||
| DEFAULT_NAMED)); | DEFAULT_NAMED)); | ||||
| strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
| "-rpcconnect=<ip>", | "-rpcconnect=<ip>", | ||||
| strprintf(_("Send commands to node running on <ip> (default: %s)"), | strprintf(_("Send commands to node running on <ip> (default: %s)"), | ||||
| ▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | if (argc < 2 || gArgs.IsArgSet("-?") || gArgs.IsArgSet("-h") || | ||||
| fprintf(stderr, "Error: too few parameters\n"); | fprintf(stderr, "Error: too few parameters\n"); | ||||
| return EXIT_FAILURE; | return EXIT_FAILURE; | ||||
| } | } | ||||
| return EXIT_SUCCESS; | return EXIT_SUCCESS; | ||||
| } | } | ||||
| if (!fs::is_directory(GetDataDir(false))) { | if (!fs::is_directory(GetDataDir(false))) { | ||||
| fprintf(stderr, | fprintf(stderr, | ||||
| "Error: Specified data directory \"%s\" does not exist.\n", | "Error: Specified data directory \"%s\" does not exist.\n", | ||||
| gArgs.GetArg("-datadir", "").c_str()); | gArgs.GetDataDir().c_str()); | ||||
| return EXIT_FAILURE; | return EXIT_FAILURE; | ||||
| } | } | ||||
| try { | try { | ||||
| gArgs.ReadConfigFile(gArgs.GetArg("-conf", BITCOIN_CONF_FILENAME)); | gArgs.ReadConfigFile(gArgs.GetArg("-conf", BITCOIN_CONF_FILENAME)); | ||||
| } catch (const std::exception &e) { | } catch (const std::exception &e) { | ||||
| fprintf(stderr, "Error reading configuration file: %s\n", e.what()); | fprintf(stderr, "Error reading configuration file: %s\n", e.what()); | ||||
| return EXIT_FAILURE; | return EXIT_FAILURE; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 336 Lines • Show Last 20 Lines | |||||