diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-10-20 16:59:33 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-10-20 17:06:28 +0200 |
commit | e26a3f6713f8f12640cdb75aad48676e901e0c75 (patch) | |
tree | d661b5d59dc32e59570910adf494155c4093faf6 /src/bitcoin-cli.cpp | |
parent | 020c4073a03a69709ed6b33d10e163ab86d65f4f (diff) | |
parent | 55a89751faaada5598771d10401030e9e86eecbd (diff) |
Merge pull request #6235
55a8975 Chainparams: Translations: DRY: options and error strings (Jorge Timón)
f3525e2 Chainparams: Replace CBaseChainParams::Network enum with string constants (suggested by Wladimir) (Jorge Timón)
Diffstat (limited to 'src/bitcoin-cli.cpp')
-rw-r--r-- | src/bitcoin-cli.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index e0fe6aa5bf..364baf9d13 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -31,9 +31,7 @@ std::string HelpMessageCli() strUsage += HelpMessageOpt("-?", _("This help message")); strUsage += HelpMessageOpt("-conf=<file>", strprintf(_("Specify configuration file (default: %s)"), "bitcoin.conf")); strUsage += HelpMessageOpt("-datadir=<dir>", _("Specify data directory")); - strUsage += HelpMessageOpt("-testnet", _("Use the test network")); - strUsage += HelpMessageOpt("-regtest", _("Enter regression test mode, which uses a special chain in which blocks can be " - "solved instantly. This is intended for regression testing tools and app development.")); + AppendParamsHelpMessages(strUsage); strUsage += HelpMessageOpt("-rpcconnect=<ip>", strprintf(_("Send commands to node running on <ip> (default: %s)"), "127.0.0.1")); strUsage += HelpMessageOpt("-rpcport=<port>", strprintf(_("Connect to JSON-RPC on <port> (default: %u or testnet: %u)"), 8332, 18332)); strUsage += HelpMessageOpt("-rpcwait", _("Wait for RPC server to start")); @@ -94,8 +92,10 @@ static bool AppInitRPC(int argc, char* argv[]) return false; } // Check for -testnet or -regtest parameter (BaseParams() calls are only valid after this clause) - if (!SelectBaseParamsFromCommandLine()) { - fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n"); + try { + SelectBaseParams(ChainNameFromCommandLine()); + } catch(std::exception &e) { + fprintf(stderr, "Error: %s\n", e.what()); return false; } if (GetBoolArg("-rpcssl", false)) |