Skip to content

Commit

Permalink
add man page
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed May 14, 2023
1 parent bd9ec2f commit 790358a
Show file tree
Hide file tree
Showing 3 changed files with 1,336 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ archives:
files:
- LICENSE
- README.md
- spot.1
rlcp: true


Expand Down Expand Up @@ -103,4 +104,3 @@ nfpms:
bindir: /usr/bin
epoch: 1
release: 1

16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,18 @@ site:
docker cp "spot-site":/srv/site/ site/public
docker rm -f spot-site

.PHONY: build release test site
man:
@echo "generating man page..."
@grep -v "<div align=\"center\">" README.md | \
grep -v "<details markdown>" | \
sed '/^<\/div>/,/^<\/details>/d' | \
sed '/<details markdown>Other install methods/,/<\/details>/d' > /tmp/temp.md
@pandoc -s -f gfm -t man -o /tmp/spot.tmp /tmp/temp.md
@echo ".TH \"SPOT\" 1 $(TAG) $(TIMESTAMP) spot manual" > spot.1
@cat /tmp/spot.tmp >> spot.1
@rm /tmp/temp.md /tmp/spot.tmp
@sed -i '' '/.TH "" "" "" "" ""/d' spot.1
@echo "made spot.1 man"


.PHONY: build release test site man version
Loading

1 comment on commit 790358a

@olegmlsn
Copy link
Contributor

Choose a reason for hiding this comment

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

For some reason, I started experimenting with WriteManPage from go-flags (https://pkg.go.dev/github.com/jessevdk/go-flags#Parser.WriteManPage). I liked your solution. Simple and elegant )

Please sign in to comment.