Output license info when binaries are passed -version

Consolidate to outputting the licensing info when we pass -version to a binary,
i.e bitcoind -version:
```bash
itcoin Core version v22.99.0-fc1f355913f6-dirty
Copyright (C) 2009-2022 The Bitcoin Core developers

Please contribute if you find Bitcoin Core useful. Visit
<https://bitcoincore.org/> for further information about the software.
The source code is available from <https://github.com/bitcoin/bitcoin>.

This is experimental software.
Distributed under the MIT software license, see the accompanying file COPYING
or <https://opensource.org/licenses/MIT>
```
This commit is contained in:
fanquake
2022-02-21 19:32:59 +00:00
parent 4c3e3c5746
commit 2618fb8d15
5 changed files with 20 additions and 7 deletions

View File

@@ -126,9 +126,10 @@ static bool AppInit(NodeContext& node, int argc, char* argv[])
if (HelpRequested(args) || args.IsArgSet("-version")) {
std::string strUsage = PACKAGE_NAME " version " + FormatFullVersion() + "\n";
if (!args.IsArgSet("-version")) {
strUsage += FormatParagraph(LicenseInfo()) + "\n"
"\nUsage: bitcoind [options] Start " PACKAGE_NAME "\n"
if (args.IsArgSet("-version")) {
strUsage += FormatParagraph(LicenseInfo());
} else {
strUsage += "\nUsage: bitcoind [options] Start " PACKAGE_NAME "\n"
"\n";
strUsage += args.GetHelpMessage();
}