Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoin-tx.cpp
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | gArgs.AddArg("sign=SIGHASH-FLAGS", | ||||
false, OptionsCategory::COMMANDS); | false, OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("load=NAME:FILENAME", | gArgs.AddArg("load=NAME:FILENAME", | ||||
_("Load JSON file FILENAME into register NAME"), false, | _("Load JSON file FILENAME into register NAME"), false, | ||||
OptionsCategory::REGISTER_COMMANDS); | OptionsCategory::REGISTER_COMMANDS); | ||||
gArgs.AddArg("set=NAME:JSON-STRING", | gArgs.AddArg("set=NAME:JSON-STRING", | ||||
_("Set register NAME to given JSON-STRING"), false, | _("Set register NAME to given JSON-STRING"), false, | ||||
OptionsCategory::REGISTER_COMMANDS); | OptionsCategory::REGISTER_COMMANDS); | ||||
// Hidden | |||||
gArgs.AddArg("-h", "", false, OptionsCategory::HIDDEN); | |||||
gArgs.AddArg("-help", "", false, OptionsCategory::HIDDEN); | |||||
} | } | ||||
// | // | ||||
// This function returns either one of EXIT_ codes when it's expected to stop | // This function returns either one of EXIT_ codes when it's expected to stop | ||||
// the process or CONTINUE_EXECUTION when it's expected to continue further. | // the process or CONTINUE_EXECUTION when it's expected to continue further. | ||||
// | // | ||||
static int AppInitRawTx(int argc, char *argv[]) { | static int AppInitRawTx(int argc, char *argv[]) { | ||||
// | // | ||||
// Parameters | // Parameters | ||||
// | // | ||||
SetupBitcoinTxArgs(); | SetupBitcoinTxArgs(); | ||||
gArgs.ParseParameters(argc, argv); | std::string error; | ||||
if (!gArgs.ParseParameters(argc, argv, error)) { | |||||
fprintf(stderr, "Error parsing command line arguments: %s\n", | |||||
error.c_str()); | |||||
return EXIT_FAILURE; | |||||
} | |||||
// Check for -testnet or -regtest parameter (Params() calls are only valid | // Check for -testnet or -regtest parameter (Params() calls are only valid | ||||
// after this clause) | // after this clause) | ||||
try { | try { | ||||
SelectParams(gArgs.GetChainName()); | SelectParams(gArgs.GetChainName()); | ||||
} catch (const std::exception &e) { | } catch (const std::exception &e) { | ||||
fprintf(stderr, "Error: %s\n", e.what()); | fprintf(stderr, "Error: %s\n", e.what()); | ||||
return EXIT_FAILURE; | return EXIT_FAILURE; | ||||
▲ Show 20 Lines • Show All 761 Lines • Show Last 20 Lines |