aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-05-24 09:28:51 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2017-05-24 09:47:54 +0200
commitcd5622dcaf55ba08d33574e36bbd21be76aa3513 (patch)
tree386b1cedb564d88352066e92cc8113c76f75b4be
parent7e96ecf075e8633f83ed1e05052402fb6b4d6186 (diff)
downloadbitcoin-cd5622dcaf55ba08d33574e36bbd21be76aa3513.tar.xz
Make bitcoind invalid argument error message specific
The current message is not helpful. Hardly anyone even remembers that bitcoind used to be a cli utility, let alone new users. Print what the actual problem is.
-rw-r--r--src/bitcoind.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp
index 31680a8ec7..5922e45801 100644
--- a/src/bitcoind.cpp
+++ b/src/bitcoind.cpp
@@ -117,17 +117,14 @@ bool AppInit(int argc, char* argv[])
return false;
}
- // Command-line RPC
- bool fCommandLine = false;
- for (int i = 1; i < argc; i++)
- if (!IsSwitchChar(argv[i][0]) && !boost::algorithm::istarts_with(argv[i], "bitcoin:"))
- fCommandLine = true;
-
- if (fCommandLine)
- {
- fprintf(stderr, "Error: There is no RPC client functionality in bitcoind anymore. Use the bitcoin-cli utility instead.\n");
- exit(EXIT_FAILURE);
+ // Error out when loose non-argument tokens are encountered on command line
+ for (int i = 1; i < argc; i++) {
+ if (!IsSwitchChar(argv[i][0])) {
+ fprintf(stderr, "Error: Command line contains unexpected token '%s', see bitcoind -h for a list of options.\n", argv[i]);
+ exit(EXIT_FAILURE);
+ }
}
+
// -server defaults to true for bitcoind but not for the GUI so do this here
SoftSetBoolArg("-server", true);
// Set this early so that parameter interactions go to console