-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: generate man pages #8525
Feature: generate man pages #8525
Conversation
Important Auto Review SkippedAuto reviews are limited to the following labels: llm-review. Please add one of these labels to enable auto reviews. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! thanks for this.
Btw - maybe add to the PR description that this replaces #7424
@@ -188,6 +188,9 @@ | |||
[Deprecate bumpclosefee for bumpforceclosefee and add `max_fee_rate` option | |||
to `closechannel` cmd](https://github.com/lightningnetwork/lnd/pull/8350). | |||
|
|||
* Generate man pages automatically using `lncli generatemanpage` command for | |||
both `lncli` and `lnd` commands when running `make install` in the Makefile (https://github.com/lightningnetwork/lnd/pull/8525). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: see how the linking is done in other entries here. Make some part of the text clickable instead of just giving the raw link
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Addressed
e1da675
to
45c7cc3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see my comment re swallowing the error warning with some bash trickery
45c7cc3
to
3727582
Compare
Thanks again @ellemouton for your review. I've addressed all your comments! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mohamedawnallah ,
I think we should instead put the script in a dedicated bash script & then call it from the makefile. That way we can reduce the logs printed out too.
So I suggest converting the makefile method to:
manpages:
@$(call print, "Generating man pages lncli.1 and lnd.1.")
./scripts/gen_man_pages.sh $(DESTDIR) $(PREFIX)
and then add a gen_man_pages.sh
file to the scripts
folder with the following contents:
#!/bin/bash
# Usage: ./gen_man_pages.sh DESTDIR PREFIX
DESTDIR="$1"
PREFIX="$2"
# Check if lncli is installed.
if ! command -v lncli &> /dev/null
then
echo "lncli could not be found. Please install lncli before running this script."
exit 1
fi
# Ignore warnings regarding HTMLBlock detection in go-md2man package
# since using "<...>" is part of our docs.
lncli generatemanpage 2>&1 | grep -v "go-md2man does not handle node type HTMLSpan" || true
echo "Installing man pages to $DESTDIR$PREFIX/share/man/man1."
install -m 644 lnd.1 "$DESTDIR$PREFIX/share/man/man1/lnd.1"
install -m 644 lncli.1 "$DESTDIR$PREFIX/share/man/man1/lncli.1"
let me know what you think :)
* [Generate man pages automatically using `lncli generatemanpage` command | ||
for both `lncli` and `lnd` commands](https://github.com/lightningnetwork/lnd/pull/8525) when running `make install` in the Makefile. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls try wrap this to 80 chars 馃檹
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Addressed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah - one other thing.
Currently, if you run make manpages
, it builds the lnd.1
and lncli.
pages in the current directory & then I think install
copies them over to the man
directory. We should delete them from the current directory.
e14be78
to
18bfb77
Compare
Thanks @ellemouton for your feedback. I agree with isolating the man pages script into an isolated bash script it is a much better solution. I've addressed all of your feedback! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mohamedawnallah - did you test this?
make manpages
Generating man pages lncli.1 and lnd.1.
./scripts/gen_man_pages.sh /usr/local
make: ./scripts/gen_man_pages.sh: Permission denied
make: *** [manpages] Error 1
you need to make sure that the new bash script file is executable.
In general, pls always make sure to tests your changes & also to wait for the CI to be green (besides some flakes) before re-requesting review 馃檹 馃槉
I'm running on |
Acknowledged 馃憤 |
18bfb77
to
a77f3db
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great work @mohamedawnallah 馃檹
One last micro nit :) otherwise - LGTM
a77f3db
to
1701c57
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice. Looks good to me, one comment about the Makefile
.
1701c57
to
8950917
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final nit, otherwise LGTM 馃帀
#? install: Build and install lnd and lncli binaries, place them in $GOPATH/bin | ||
install: | ||
#? install: Build and install lnd and lncli binaries, place them in $GOPATH/bin. | ||
install-binaries: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the help hint for this make goal is now outdated. Also, looking at all other help hints, we don't use full stops at the end of sentences everywhere else, so let's make this and the ones below consistent with the rest of the file.
09dc489
to
bec5764
Compare
bec5764
to
fb5b425
Compare
Change Description
Generate man pages automatically for both
lncli
andlnd
commands and move the artifacts man pageslncli.1
andlnd.1
to/usr/local/share/man/man1
directory that process happens while runningmake install
command.Fixes #5605
Replaces #7424
Steps to Test
Steps for reviewers to follow to test the change.
Pull Request Checklist
Testing
Code Style and Documentation
[skip ci]
in the commit message for small changes.馃摑 Please see our Contribution Guidelines for further guidance.