Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoin-cli.cpp
Show All 16 Lines | |||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <event2/buffer.h> | #include <event2/buffer.h> | ||||
#include <event2/keyvalq_struct.h> | #include <event2/keyvalq_struct.h> | ||||
#include <univalue.h> | #include <univalue.h> | ||||
#include <cstdio> | #include <cstdio> | ||||
#include <tuple> | |||||
static const char DEFAULT_RPCCONNECT[] = "127.0.0.1"; | static const char DEFAULT_RPCCONNECT[] = "127.0.0.1"; | ||||
static const int DEFAULT_HTTP_CLIENT_TIMEOUT = 900; | static const int DEFAULT_HTTP_CLIENT_TIMEOUT = 900; | ||||
static const bool DEFAULT_NAMED = false; | static const bool DEFAULT_NAMED = false; | ||||
static const int CONTINUE_EXECUTION = -1; | static const int CONTINUE_EXECUTION = -1; | ||||
static void SetupCliArgs() { | static void SetupCliArgs() { | ||||
const auto defaultBaseParams = | const auto defaultBaseParams = | ||||
▲ Show 20 Lines • Show All 565 Lines • ▼ Show 20 Lines | static int CommandLineRPC(int argc, char *argv[]) { | ||||
if (strPrint != "") { | if (strPrint != "") { | ||||
fprintf((nRet == 0 ? stdout : stderr), "%s\n", strPrint.c_str()); | fprintf((nRet == 0 ? stdout : stderr), "%s\n", strPrint.c_str()); | ||||
} | } | ||||
return nRet; | return nRet; | ||||
} | } | ||||
int main(int argc, char *argv[]) { | int main(int argc, char *argv[]) { | ||||
#ifdef WIN32 | |||||
util::WinCmdLineArgs winArgs; | |||||
std::tie(argc, argv) = winArgs.get(); | |||||
#endif | |||||
SetupEnvironment(); | SetupEnvironment(); | ||||
if (!SetupNetworking()) { | if (!SetupNetworking()) { | ||||
fprintf(stderr, "Error: Initializing networking failed\n"); | fprintf(stderr, "Error: Initializing networking failed\n"); | ||||
return EXIT_FAILURE; | return EXIT_FAILURE; | ||||
} | } | ||||
try { | try { | ||||
int ret = AppInitRPC(argc, argv); | int ret = AppInitRPC(argc, argv); | ||||
Show All 21 Lines |