Skip to content

Commit f842d08

Browse files
committed
Merge bitcoin/bitcoin#29686: Update manpage descriptions
47f50c7 doc: add bitcoin-qt man description (willcl-ark) 40b82e3 doc: add bitcoin-util man description (willcl-ark) a7bf80f doc: add bitcoin-tx man description (willcl-ark) 3f9a516 doc: add bitcoin-wallet man description (willcl-ark) d8c0bb2 doc: add bitcoin-cli man description (willcl-ark) 09abccf doc: add bitcoind man description (willcl-ark) Pull request description: Closes #29552 Add better descriptions to help string for all binaries. Use format which is correctly detected by help2man when generating manpages. Examples: Before: ![image](https://github.com/bitcoin/bitcoin/assets/6606587/9f6a5dbd-b18b-416b-827b-1c260d7a1274) After: ![image](https://github.com/bitcoin/bitcoin/assets/6606587/179082a1-1082-4204-bad7-56260d0fdefc) Demonstration using `bitcoin-cli` also highlights removal of inline usage explanations which were being incorrectly formatted by `help2man`. This results in the following changed format to `bitcoin-cli --help`: ![image](https://github.com/bitcoin/bitcoin/assets/6606587/dbebb99f-e419-40cd-a82d-e87f33351fea) ACKs for top commit: achow101: ACK 47f50c7 tdb3: re ACK 47f50c7 rkrux: tACK 47f50c7 maflcko: ACK 47f50c7 📠 Tree-SHA512: 124a8877077b7d47758ea970949d472b2444e3ba65d2bfeb47ebbdb1f5f8d3bf0abe2c88714bb6c92ba0e36583f0b36aa6f016ea88b65f011c610096ea872182
2 parents 018e5fc + 47f50c7 commit f842d08

File tree

6 files changed

+39
-17
lines changed

6 files changed

+39
-17
lines changed

src/bitcoin-cli.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,16 @@ static int AppInitRPC(int argc, char* argv[])
152152
strUsage += FormatParagraph(LicenseInfo());
153153
} else {
154154
strUsage += "\n"
155-
"Usage: bitcoin-cli [options] <command> [params] Send command to " CLIENT_NAME "\n"
156-
"or: bitcoin-cli [options] -named <command> [name=value]... Send command to " CLIENT_NAME " (with named arguments)\n"
157-
"or: bitcoin-cli [options] help List commands\n"
158-
"or: bitcoin-cli [options] help <command> Get help for a command\n";
155+
"The bitcoin-cli utility provides a command line interface to interact with a " CLIENT_NAME " RPC server.\n"
156+
"\nIt can be used to query network information, manage wallets, create or broadcast transactions, and control the " CLIENT_NAME " server.\n"
157+
"\nUse the \"help\" command to list all commands. Use \"help <command>\" to show help for that command.\n"
158+
"The -named option allows you to specify parameters using the key=value format, eliminating the need to pass unused positional parameters.\n"
159+
"\n"
160+
"Usage: bitcoin-cli [options] <command> [params]\n"
161+
"or: bitcoin-cli [options] -named <command> [name=value]...\n"
162+
"or: bitcoin-cli [options] help\n"
163+
"or: bitcoin-cli [options] help <command>\n"
164+
"\n";
159165
strUsage += "\n" + gArgs.GetHelpMessage();
160166
}
161167

src/bitcoin-tx.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,11 @@ static int AppInitRawTx(int argc, char* argv[])
113113
strUsage += FormatParagraph(LicenseInfo());
114114
} else {
115115
strUsage += "\n"
116-
"Usage: bitcoin-tx [options] <hex-tx> [commands] Update hex-encoded bitcoin transaction\n"
117-
"or: bitcoin-tx [options] -create [commands] Create hex-encoded bitcoin transaction\n"
116+
"The bitcoin-tx tool is used for creating and modifying bitcoin transactions.\n\n"
117+
"bitcoin-tx can be used with \"<hex-tx> [commands]\" to update a hex-encoded bitcoin transaction, or with \"-create [commands]\" to create a hex-encoded bitcoin transaction.\n"
118+
"\n"
119+
"Usage: bitcoin-tx [options] <hex-tx> [commands]\n"
120+
"or: bitcoin-tx [options] -create [commands]\n"
118121
"\n";
119122
strUsage += gArgs.GetHelpMessage();
120123
}

src/bitcoin-util.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ static int AppInitUtil(ArgsManager& args, int argc, char* argv[])
5858
strUsage += FormatParagraph(LicenseInfo());
5959
} else {
6060
strUsage += "\n"
61-
"Usage: bitcoin-util [options] [commands] Do stuff\n";
61+
"The bitcoin-util tool provides bitcoin related functionality that does not rely on the ability to access a running node. Available [commands] are listed below.\n"
62+
"\n"
63+
"Usage: bitcoin-util [options] [command]\n"
64+
"or: bitcoin-util [options] grind <hex-block-header>\n";
6265
strUsage += "\n" + args.GetHelpMessage();
6366
}
6467

src/bitcoin-wallet.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,18 @@ static std::optional<int> WalletAppInit(ArgsManager& args, int argc, char* argv[
6161
}
6262
const bool missing_args{argc < 2};
6363
if (missing_args || HelpRequested(args) || args.IsArgSet("-version")) {
64-
std::string strUsage = strprintf("%s bitcoin-wallet version", CLIENT_NAME) + " " + FormatFullVersion() + "\n";
64+
std::string strUsage = strprintf("%s bitcoin-wallet utility version", CLIENT_NAME) + " " + FormatFullVersion() + "\n";
6565

6666
if (args.IsArgSet("-version")) {
6767
strUsage += FormatParagraph(LicenseInfo());
6868
} else {
6969
strUsage += "\n"
70-
"bitcoin-wallet is an offline tool for creating and interacting with " CLIENT_NAME " wallet files.\n"
71-
"By default bitcoin-wallet will act on wallets in the default mainnet wallet directory in the datadir.\n"
72-
"To change the target wallet, use the -datadir, -wallet and -regtest/-signet/-testnet/-testnet4 arguments.\n\n"
73-
"Usage:\n"
74-
" bitcoin-wallet [options] <command>\n";
70+
"bitcoin-wallet is an offline tool for creating and interacting with " CLIENT_NAME " wallet files.\n\n"
71+
"By default bitcoin-wallet will act on wallets in the default mainnet wallet directory in the datadir.\n\n"
72+
"To change the target wallet, use the -datadir, -wallet and -regtest / -signet / -testnet arguments.\n"
73+
"\n"
74+
"Usage: bitcoin-wallet [options] <command>\n"
75+
"\n";
7576
strUsage += "\n" + args.GetHelpMessage();
7677
}
7778
tfm::format(std::cout, "%s", strUsage);

src/bitcoind.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,18 @@ static bool ProcessInitCommands(ArgsManager& args)
136136
{
137137
// Process help and version before taking care about datadir
138138
if (HelpRequested(args) || args.IsArgSet("-version")) {
139-
std::string strUsage = CLIENT_NAME " version " + FormatFullVersion() + "\n";
139+
std::string strUsage = CLIENT_NAME " daemon version " + FormatFullVersion() + "\n";
140140

141141
if (args.IsArgSet("-version")) {
142142
strUsage += FormatParagraph(LicenseInfo());
143143
} else {
144-
strUsage += "\nUsage: bitcoind [options] Start " CLIENT_NAME "\n"
144+
strUsage += "\n"
145+
"The " CLIENT_NAME " daemon (bitcoind) is a headless program that connects to the Bitcoin network to validate and relay transactions and blocks, as well as relaying addresses.\n\n"
146+
"It provides the backbone of the Bitcoin network and its RPC, REST and ZMQ services can provide various transaction, block and address-related services.\n\n"
147+
"There is an optional wallet component which provides transaction services.\n\n"
148+
"It can be used in a headless environment or as part of a server setup.\n"
149+
"\n"
150+
"Usage: bitcoind [options]\n"
145151
"\n";
146152
strUsage += args.GetHelpMessage();
147153
}

src/qt/utilitydialog.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,11 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) :
5656
ui->helpMessage->setVisible(false);
5757
} else {
5858
setWindowTitle(tr("Command-line options"));
59-
QString header = "Usage: bitcoin-qt [command-line options] [URI]\n\n"
60-
"Optional URI is a Bitcoin address in BIP21 URI format.\n";
59+
QString header = "The bitcoin-qt application provides a graphical interface for interacting with " CLIENT_NAME ".\n\n"
60+
"It combines the core functionalities of bitcoind with a user-friendly interface for wallet management, transaction history, and network statistics.\n\n"
61+
"It is suitable for users who prefer a graphical over a command-line interface.\n\n"
62+
"You can optionally specify a payment [URI], in e.g. the BIP21 URI format.\n\n"
63+
"Usage: bitcoin-qt [options] [URI]\n\n";
6164
QTextCursor cursor(ui->helpMessage->document());
6265
cursor.insertText(version);
6366
cursor.insertBlock();

0 commit comments

Comments
 (0)