Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoin-cli.cpp
Show All 29 Lines | |||||
const std::function<std::string(const char *)> G_TRANSLATION_FUN = nullptr; | const std::function<std::string(const char *)> G_TRANSLATION_FUN = nullptr; | ||||
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() { | ||||
SetupHelpOptions(gArgs); | |||||
const auto defaultBaseParams = | const auto defaultBaseParams = | ||||
CreateBaseChainParams(CBaseChainParams::MAIN); | CreateBaseChainParams(CBaseChainParams::MAIN); | ||||
const auto testnetBaseParams = | const auto testnetBaseParams = | ||||
CreateBaseChainParams(CBaseChainParams::TESTNET); | CreateBaseChainParams(CBaseChainParams::TESTNET); | ||||
const auto regtestBaseParams = | const auto regtestBaseParams = | ||||
CreateBaseChainParams(CBaseChainParams::REGTEST); | CreateBaseChainParams(CBaseChainParams::REGTEST); | ||||
gArgs.AddArg("-?", "This help message", ArgsManager::ALLOW_ANY, | |||||
OptionsCategory::OPTIONS); | |||||
gArgs.AddArg("-version", "Print version and exit", ArgsManager::ALLOW_ANY, | gArgs.AddArg("-version", "Print version and exit", ArgsManager::ALLOW_ANY, | ||||
OptionsCategory::OPTIONS); | OptionsCategory::OPTIONS); | ||||
gArgs.AddArg("-conf=<file>", | gArgs.AddArg("-conf=<file>", | ||||
strprintf("Specify configuration file. Relative paths will be " | strprintf("Specify configuration file. Relative paths will be " | ||||
"prefixed by datadir location. (default: %s)", | "prefixed by datadir location. (default: %s)", | ||||
BITCOIN_CONF_FILENAME), | BITCOIN_CONF_FILENAME), | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); | ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); | ||||
gArgs.AddArg("-datadir=<dir>", "Specify data directory", | gArgs.AddArg("-datadir=<dir>", "Specify data directory", | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | gArgs.AddArg("-stdin", | ||||
"EOF/Ctrl-D (recommended for sensitive information such as " | "EOF/Ctrl-D (recommended for sensitive information such as " | ||||
"passphrases)", | "passphrases)", | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); | ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); | ||||
gArgs.AddArg( | gArgs.AddArg( | ||||
"-rpcwallet=<walletname>", | "-rpcwallet=<walletname>", | ||||
"Send RPC for non-default wallet on RPC server (needs to exactly match " | "Send RPC for non-default wallet on RPC server (needs to exactly match " | ||||
"corresponding -wallet option passed to bitcoind)", | "corresponding -wallet option passed to bitcoind)", | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); | ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); | ||||
// Hidden | |||||
gArgs.AddArg("-h", "", ArgsManager::ALLOW_ANY, OptionsCategory::HIDDEN); | |||||
gArgs.AddArg("-help", "", ArgsManager::ALLOW_ANY, OptionsCategory::HIDDEN); | |||||
} | } | ||||
/** libevent event log callback */ | /** libevent event log callback */ | ||||
static void libevent_log_cb(int severity, const char *msg) { | static void libevent_log_cb(int severity, const char *msg) { | ||||
#ifndef EVENT_LOG_ERR | #ifndef EVENT_LOG_ERR | ||||
// EVENT_LOG_ERR was added in 2.0.19; but before then _EVENT_LOG_ERR existed. | // EVENT_LOG_ERR was added in 2.0.19; but before then _EVENT_LOG_ERR existed. | ||||
#define EVENT_LOG_ERR _EVENT_LOG_ERR | #define EVENT_LOG_ERR _EVENT_LOG_ERR | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 525 Lines • Show Last 20 Lines |