Skip to content

Conversation

@hebasto
Copy link
Member

@hebasto hebasto commented Aug 7, 2018

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a . in this line as well. What makes it work here and not below?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right (and I didn't catch it). But somehow help2man parses badly only the second line.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarcoFalke more precisely: the FormatParagraph call makes -stdin option output without two spaces between words; that's why help2man parses it without any issue.

@maflcko
Copy link
Member

maflcko commented Aug 7, 2018

For future reference: Note that you can just git push with --force as flag to avoid having to reopen the pull request.

Copy link
Member Author

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right (and I didn't catch it). But somehow help2man parses badly only the second line.

@DrahtBot
Copy link
Contributor

DrahtBot commented Aug 7, 2018

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.

@laanwj
Copy link
Member

laanwj commented Aug 8, 2018

This pull request is rebased from #13879

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.

@hebasto
Copy link
Member Author

hebasto commented Aug 8, 2018

@MarcoFalke, @laanwj

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.

@maflcko
Copy link
Member

maflcko commented Aug 12, 2018

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.
@hebasto hebasto force-pushed the bitcoin-cli-help2man-rebased branch from e5bd007 to 869193f Compare August 13, 2018 09:49
@fanquake
Copy link
Member

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

@hebasto
Copy link
Member Author

hebasto commented Aug 13, 2018

@maflcko
Copy link
Member

maflcko commented Aug 13, 2018

Diff looks good. ACK 869193f

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

@maflcko maflcko merged commit 869193f into bitcoin:master Aug 13, 2018
@hebasto hebasto deleted the bitcoin-cli-help2man-rebased branch August 13, 2018 13:13
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Oct 25, 2020
Summary:
This includes a sentence in the documentation of `-stdin` that was missed while backporting [[bitcoin/bitcoin#10997 | PR10997]] (D1042),
and the removal of a redundant `strprintf`. The double space was already removed in D3058.

This is a backport of Core [[bitcoin/bitcoin#13905 | PR13905]]

Test Plan:
`ninja && ninja check`
`bitcoin-cli -help`

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D8105
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 29, 2021
869193f docs: fixed bitcoin-cli -help output for help2man (Hennadii Stepanov)

Pull request description:

  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 bitcoin#13879

Tree-SHA512: 1c5b25ed2ef7b7de42bc6210165bdbabe63f045699487f2db4790e0d3176f6493dfd3e8e19f4ddc38b551539465d7b41aea570f20dccbc0609f00fdfee1b5180
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants