Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoin-wallet.cpp
Show All 12 Lines | |||||
#include <util/translation.h> | #include <util/translation.h> | ||||
#include <wallet/wallettool.h> | #include <wallet/wallettool.h> | ||||
#include <functional> | #include <functional> | ||||
const std::function<std::string(const char *)> G_TRANSLATION_FUN = nullptr; | const std::function<std::string(const char *)> G_TRANSLATION_FUN = nullptr; | ||||
static void SetupWalletToolArgs() { | static void SetupWalletToolArgs() { | ||||
SetupHelpOptions(gArgs); | |||||
SetupChainParamsBaseOptions(); | SetupChainParamsBaseOptions(); | ||||
gArgs.AddArg("-?", "This help message", ArgsManager::ALLOW_ANY, | |||||
OptionsCategory::OPTIONS); | |||||
gArgs.AddArg("-datadir=<dir>", "Specify data directory", | gArgs.AddArg("-datadir=<dir>", "Specify data directory", | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); | ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); | ||||
gArgs.AddArg("-wallet=<wallet-name>", "Specify wallet name", | gArgs.AddArg("-wallet=<wallet-name>", "Specify wallet name", | ||||
ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, | ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, | ||||
OptionsCategory::OPTIONS); | OptionsCategory::OPTIONS); | ||||
gArgs.AddArg("-debug=<category>", | gArgs.AddArg("-debug=<category>", | ||||
"Output debugging information (default: 0).", | "Output debugging information (default: 0).", | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); | ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); | ||||
gArgs.AddArg("-printtoconsole", | gArgs.AddArg("-printtoconsole", | ||||
"Send trace/debug info to console (default: 1 when no -debug " | "Send trace/debug info to console (default: 1 when no -debug " | ||||
"is true, 0 otherwise).", | "is true, 0 otherwise).", | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); | ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); | ||||
gArgs.AddArg("info", "Get wallet info", ArgsManager::ALLOW_ANY, | gArgs.AddArg("info", "Get wallet info", ArgsManager::ALLOW_ANY, | ||||
OptionsCategory::COMMANDS); | OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("create", "Create new wallet file", ArgsManager::ALLOW_ANY, | gArgs.AddArg("create", "Create new wallet file", ArgsManager::ALLOW_ANY, | ||||
OptionsCategory::COMMANDS); | OptionsCategory::COMMANDS); | ||||
// Hidden | |||||
gArgs.AddArg("-h", "", ArgsManager::ALLOW_ANY, OptionsCategory::HIDDEN); | |||||
gArgs.AddArg("-help", "", ArgsManager::ALLOW_ANY, OptionsCategory::HIDDEN); | |||||
} | } | ||||
static bool WalletAppInit(int argc, char *argv[]) { | static bool WalletAppInit(int argc, char *argv[]) { | ||||
SetupWalletToolArgs(); | SetupWalletToolArgs(); | ||||
std::string error_message; | std::string error_message; | ||||
if (!gArgs.ParseParameters(argc, argv, error_message)) { | if (!gArgs.ParseParameters(argc, argv, error_message)) { | ||||
tfm::format(std::cerr, "Error parsing command line arguments: %s\n", | tfm::format(std::cerr, "Error parsing command line arguments: %s\n", | ||||
error_message); | error_message); | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |