Currently bitcon-cli -help output forces help2man to produce .TP and .IP commands instead of a single .IP command for -stdinrpcpass option.
Removing an extra space fixes this issue.
This pull request is rebased from #13879
49 | @@ -50,7 +50,7 @@ static void SetupCliArgs()
50 | gArgs.AddArg("-rpcwait", "Wait for RPC server to start", false, OptionsCategory::OPTIONS);
51 | gArgs.AddArg("-rpcwallet=<walletname>", "Send RPC for non-default wallet on RPC server (needs to exactly match corresponding -wallet option passed to bitcoind)", false, OptionsCategory::OPTIONS);
52 | gArgs.AddArg("-stdin", "Read extra arguments from standard input, one per line until EOF/Ctrl-D (recommended for sensitive information such as passphrases). When combined with -stdinrpcpass, the first line from standard input is used for the RPC password.", false, OptionsCategory::OPTIONS);
There is a . in this line as well. What makes it work here and not below?
You're right (and I didn't catch it). But somehow help2man parses badly only the second line.
@MarcoFalke more precisely: the FormatParagraph call makes -stdin option output without two spaces between words; that's why help2man parses it without any issue.
For future reference: Note that you can just git push with --force as flag to avoid having to reopen the pull request.
Thanks to @MarcoFalke it is obviously bug was caused by combination a redundant strprintf call with an extra space. Both are fixed with force push.
<!--e57a25ab6845829454e8d69fc972939a-->Note to reviewers: This pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
Yes, please don't open new PRs for the same thing, but force-push to the old one. Otherwise it splits the discussion over a whole trail of PRs which doesn't make things easier for maintainers.
Yes, I will follow the rules. I beg your pardon.
Please squash your commits according to https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#squashing-commits
(Might as well do a rebase, since there wasn't any review yet)
The `help2man` parses a string containing two spaces between words with an issue:
it gives out `.TP` and `.IP` commands instead of a single `.IP` command.
Removing an extra space fixes this issue.
Currently the `-help` output for the `-stdin` option looks without any issue due to eliminating
of two spaces between words by a `FormatParagraph` call for this particular case.
For consistency and preventing from future regressions extra spaces have been removed from the both lines.
The redundant `strprintf` call has been removed aswell.
Output generated using help2man src/bitcoin-cli.
master (2115cba):
\fB\-stdinrpcpass\fR
.TP
Read RPC password from standard input as a single line.
When combined
.IP
with \fB\-stdin\fR, the first line from standard input is used for the
RPC password.
.HP
This PR (869193f):
\fB\-stdinrpcpass\fR
.IP
Read RPC password from standard input as a single line. When combined
with \fB\-stdin\fR, the first line from standard input is used for the
RPC password.
.HP
Please squash your commits according to https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#squashing-commits
Done.
Diff looks good. ACK 869193f5a6398bb9e4a6f4a7aeb8d2203193c80f
diff --git a/doc/man/bitcoin-cli.1 b/doc/man/bitcoin-cli.1
index 1da4c3aa03..639cc93f4c 100644
--- a/doc/man/bitcoin-cli.1
+++ b/doc/man/bitcoin-cli.1
@@ -75,27 +75,25 @@ Wait for RPC server to start
.HP
\fB\-rpcwallet=\fR<walletname>
.IP
Send RPC for non\-default wallet on RPC server (needs to exactly match
corresponding \fB\-wallet\fR option passed to bitcoind)
.HP
\fB\-stdin\fR
.IP
Read extra arguments from standard input, one per line until EOF/Ctrl\-D
-(recommended for sensitive information such as passphrases).
-When combined with \fB\-stdinrpcpass\fR, the first line from standard
-input is used for the RPC password.
+(recommended for sensitive information such as passphrases). When
+combined with \fB\-stdinrpcpass\fR, the first line from standard input
+is used for the RPC password.
.HP
\fB\-stdinrpcpass\fR
-.TP
-Read RPC password from standard input as a single line.
-When combined
.IP
+Read RPC password from standard input as a single line. When combined
with \fB\-stdin\fR, the first line from standard input is used for the
RPC password.
.HP
\fB\-version\fR
.IP
Print version and exit
.PP
Chain selection options:
.HP