mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-09 11:27:28 -03:00
scripted-diff: Avoid printing version information for -noversion
-BEGIN VERIFY SCRIPT- sed -i --regexp-extended 's/\b(gArgs|args)\.IsArgSet\("-version"\)/\1.GetBoolArg("-version", false)/g' $(git grep -l '-version') -END VERIFY SCRIPT-
This commit is contained in:
parent
e8a2054edc
commit
6ff9662760
6 changed files with 12 additions and 12 deletions
|
@ -145,10 +145,10 @@ static int AppInitRPC(int argc, char* argv[])
|
|||
tfm::format(std::cerr, "Error parsing command line arguments: %s\n", error);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (argc < 2 || HelpRequested(gArgs) || gArgs.IsArgSet("-version")) {
|
||||
if (argc < 2 || HelpRequested(gArgs) || gArgs.GetBoolArg("-version", false)) {
|
||||
std::string strUsage = CLIENT_NAME " RPC client version " + FormatFullVersion() + "\n";
|
||||
|
||||
if (gArgs.IsArgSet("-version")) {
|
||||
if (gArgs.GetBoolArg("-version", false)) {
|
||||
strUsage += FormatParagraph(LicenseInfo());
|
||||
} else {
|
||||
strUsage += "\n"
|
||||
|
|
|
@ -105,11 +105,11 @@ static int AppInitRawTx(int argc, char* argv[])
|
|||
|
||||
fCreateBlank = gArgs.GetBoolArg("-create", false);
|
||||
|
||||
if (argc < 2 || HelpRequested(gArgs) || gArgs.IsArgSet("-version")) {
|
||||
if (argc < 2 || HelpRequested(gArgs) || gArgs.GetBoolArg("-version", false)) {
|
||||
// First part of help message is specific to this utility
|
||||
std::string strUsage = CLIENT_NAME " bitcoin-tx utility version " + FormatFullVersion() + "\n";
|
||||
|
||||
if (gArgs.IsArgSet("-version")) {
|
||||
if (gArgs.GetBoolArg("-version", false)) {
|
||||
strUsage += FormatParagraph(LicenseInfo());
|
||||
} else {
|
||||
strUsage += "\n"
|
||||
|
|
|
@ -50,11 +50,11 @@ static int AppInitUtil(ArgsManager& args, int argc, char* argv[])
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (HelpRequested(args) || args.IsArgSet("-version")) {
|
||||
if (HelpRequested(args) || args.GetBoolArg("-version", false)) {
|
||||
// First part of help message is specific to this utility
|
||||
std::string strUsage = CLIENT_NAME " bitcoin-util utility version " + FormatFullVersion() + "\n";
|
||||
|
||||
if (args.IsArgSet("-version")) {
|
||||
if (args.GetBoolArg("-version", false)) {
|
||||
strUsage += FormatParagraph(LicenseInfo());
|
||||
} else {
|
||||
strUsage += "\n"
|
||||
|
|
|
@ -60,10 +60,10 @@ static std::optional<int> WalletAppInit(ArgsManager& args, int argc, char* argv[
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
const bool missing_args{argc < 2};
|
||||
if (missing_args || HelpRequested(args) || args.IsArgSet("-version")) {
|
||||
if (missing_args || HelpRequested(args) || args.GetBoolArg("-version", false)) {
|
||||
std::string strUsage = strprintf("%s bitcoin-wallet utility version", CLIENT_NAME) + " " + FormatFullVersion() + "\n";
|
||||
|
||||
if (args.IsArgSet("-version")) {
|
||||
if (args.GetBoolArg("-version", false)) {
|
||||
strUsage += FormatParagraph(LicenseInfo());
|
||||
} else {
|
||||
strUsage += "\n"
|
||||
|
|
|
@ -135,10 +135,10 @@ static bool ParseArgs(NodeContext& node, int argc, char* argv[])
|
|||
static bool ProcessInitCommands(ArgsManager& args)
|
||||
{
|
||||
// Process help and version before taking care about datadir
|
||||
if (HelpRequested(args) || args.IsArgSet("-version")) {
|
||||
if (HelpRequested(args) || args.GetBoolArg("-version", false)) {
|
||||
std::string strUsage = CLIENT_NAME " daemon version " + FormatFullVersion() + "\n";
|
||||
|
||||
if (args.IsArgSet("-version")) {
|
||||
if (args.GetBoolArg("-version", false)) {
|
||||
strUsage += FormatParagraph(LicenseInfo());
|
||||
} else {
|
||||
strUsage += "\n"
|
||||
|
|
|
@ -582,8 +582,8 @@ int GuiMain(int argc, char* argv[])
|
|||
|
||||
// Show help message immediately after parsing command-line options (for "-lang") and setting locale,
|
||||
// but before showing splash screen.
|
||||
if (HelpRequested(gArgs) || gArgs.IsArgSet("-version")) {
|
||||
HelpMessageDialog help(nullptr, gArgs.IsArgSet("-version"));
|
||||
if (HelpRequested(gArgs) || gArgs.GetBoolArg("-version", false)) {
|
||||
HelpMessageDialog help(nullptr, gArgs.GetBoolArg("-version", false));
|
||||
help.showOrPrint();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue