aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-util.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2021-01-12 14:01:09 +0100
committerWladimir J. van der Laan <laanwj@protonmail.com>2021-01-12 14:09:21 +0100
commitb5e93f873aee96e8d7cd932f5e82efa9ecb6b2f0 (patch)
treed65ba501f3cc99417460b80cf11ad174b9eb607a /src/bitcoin-util.cpp
parent7b975639ef93b50537a3ec6326b54d7218afc8da (diff)
doc: Add manual page generation for bitcoin-util
- Add `-version` option to `bitcoin-util` - Add `bitcoin-util` call to `gen-manpages.sh` - Add stub manual page `bitcoin-util.1` - Add install of `bitcoin-util.1` to build system
Diffstat (limited to 'src/bitcoin-util.cpp')
-rw-r--r--src/bitcoin-util.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/bitcoin-util.cpp b/src/bitcoin-util.cpp
index f7e670f4e0..b702a68bdf 100644
--- a/src/bitcoin-util.cpp
+++ b/src/bitcoin-util.cpp
@@ -40,6 +40,8 @@ static void SetupBitcoinUtilArgs(ArgsManager &argsman)
{
SetupHelpOptions(argsman);
+ argsman.AddArg("-version", "Print version and exit", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
+
SetupChainParamsBaseOptions(argsman);
}
@@ -62,12 +64,14 @@ static int AppInitUtil(int argc, char* argv[])
return EXIT_FAILURE;
}
- if (argc < 2 || HelpRequested(gArgs)) {
+ if (argc < 2 || HelpRequested(gArgs) || gArgs.IsArgSet("-version")) {
// First part of help message is specific to this utility
- std::string strUsage = PACKAGE_NAME " bitcoin-util utility version " + FormatFullVersion() + "\n\n" +
- "Usage: bitcoin-util [options] [commands] Do stuff\n" +
- "\n";
- strUsage += gArgs.GetHelpMessage();
+ std::string strUsage = PACKAGE_NAME " bitcoin-util utility version " + FormatFullVersion() + "\n";
+ if (!gArgs.IsArgSet("-version")) {
+ strUsage += "\n"
+ "Usage: bitcoin-util [options] [commands] Do stuff\n";
+ strUsage += "\n" + gArgs.GetHelpMessage();
+ }
tfm::format(std::cout, "%s", strUsage);