mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
Chainparams: Translations: DRY: options and error strings
Also remove SelectBaseParamsFromCommandLine and SelectParamsFromCommandLine
This commit is contained in:
parent
f3525e24e3
commit
55a89751fa
9 changed files with 37 additions and 51 deletions
|
|
@ -35,8 +35,10 @@ static bool AppInitRawTx(int argc, char* argv[])
|
|||
ParseParameters(argc, argv);
|
||||
|
||||
// Check for -testnet or -regtest parameter (Params() calls are only valid after this clause)
|
||||
if (!SelectParamsFromCommandLine()) {
|
||||
fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n");
|
||||
try {
|
||||
SelectParams(ChainNameFromCommandLine());
|
||||
} catch(std::exception &e) {
|
||||
fprintf(stderr, "Error: %s\n", e.what());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -58,8 +60,7 @@ static bool AppInitRawTx(int argc, char* argv[])
|
|||
strUsage += HelpMessageOpt("-create", _("Create new, empty TX."));
|
||||
strUsage += HelpMessageOpt("-json", _("Select JSON output"));
|
||||
strUsage += HelpMessageOpt("-txid", _("Output only the hex-encoded transaction id of the resultant transaction."));
|
||||
strUsage += HelpMessageOpt("-regtest", _("Enter regression test mode, which uses a special chain in which blocks can be solved instantly."));
|
||||
strUsage += HelpMessageOpt("-testnet", _("Use the test network"));
|
||||
AppendParamsHelpMessages(strUsage);
|
||||
|
||||
fprintf(stdout, "%s", strUsage.c_str());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue