refactor: add unused ArgsManager to replace gArgs

This commit is contained in:
Ivan Metlushko
2020-07-19 14:31:51 +07:00
parent 2f71a1ea35
commit a316e9ce26
10 changed files with 28 additions and 23 deletions

View File

@ -36,14 +36,14 @@ static const int CONTINUE_EXECUTION=-1;
const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr;
static void SetupBitcoinTxArgs()
static void SetupBitcoinTxArgs(ArgsManager &argsman)
{
SetupHelpOptions(gArgs);
SetupHelpOptions(argsman);
gArgs.AddArg("-create", "Create new, empty TX.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
gArgs.AddArg("-json", "Select JSON output", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
gArgs.AddArg("-txid", "Output only the hex-encoded transaction id of the resultant transaction.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
SetupChainParamsBaseOptions();
SetupChainParamsBaseOptions(argsman);
gArgs.AddArg("delin=N", "Delete input N from TX", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS);
gArgs.AddArg("delout=N", "Delete output N from TX", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS);
@ -81,7 +81,7 @@ static int AppInitRawTx(int argc, char* argv[])
//
// Parameters
//
SetupBitcoinTxArgs();
SetupBitcoinTxArgs(gArgs);
std::string error;
if (!gArgs.ParseParameters(argc, argv, error)) {
tfm::format(std::cerr, "Error parsing command line arguments: %s\n", error);