about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNguyễn Gia Phong <cnx@loang.net>2025-05-29 11:30:53 +0900
committerNguyễn Gia Phong <cnx@loang.net>2025-05-29 11:30:53 +0900
commit0f96928df28305b089f9e34055fdf835da368c40 (patch)
tree92eb80c6b9351c28f3b722bd06fbb93502b50133
parentdbfc5f4ff56ec65ec04a558d8715f1df7844dffa (diff)
downloadscadere-0f96928df28305b089f9e34055fdf835da368c40.tar.gz
Document a wee moar
-rw-r--r--.gitignore1
-rw-r--r--README.md33
-rw-r--r--doc/Makefile48
-rw-r--r--doc/check.h2m2
-rw-r--r--doc/common.h2m12
-rw-r--r--doc/listen.h2m2
6 files changed, 83 insertions, 15 deletions
diff --git a/.gitignore b/.gitignore
index cc74c32..e350d40 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+*.1
 .coverage
 .hypothesis/
 .pytest_cache/
diff --git a/README.md b/README.md
index df58aaf..9d5d710 100644
--- a/README.md
+++ b/README.md
@@ -8,13 +8,14 @@ that are about to expire and provides an Atom feed for notification.
 ### Expiration checking
 
 ```console
-$ scadere check --help
-Usage: scadere check [-h] [-d DAYS] [-o PATH] HOST[:PORT] [HOST[:PORT] ...]
+$ scadere-check --help
+Usage: scadere-check [-h] [-v] [-d DAYS] [-o PATH] HOST[:PORT]...
 
 Check TLS certificate expiration of HOST, where PORT defaults to 443.
 
 Options:
   -h, --help            show this help message and exit
+  -v, --version         show program's version number and exit
   -d DAYS, --days=DAYS  days before expiration (default to 7)
   -o PATH, --output=PATH
                         output file (default to stdout)
@@ -25,15 +26,16 @@ It is recommended to run `scadere check` as a cron job.
 ### Expiration notification
 
 ```console
-$ scadere listen --help
-Usage: scadere listen [-h] INPUT URL [[HOST][:PORT]]
+$ scadere-listen --help
+Usage: scadere-listen [-h] [-v] INPUT URL [[HOST][:PORT]]
 
 Serve the TLS certificate expiration feed from INPUT file
 for base URL at HOST:PORT, where HOST defaults to localhost
 and PORT is selected randomly if not specified.
 
 Options:
-  -h, --help  show this help message and exit
+  -h, --help     show this help message and exit
+  -v, --version  show program's version number and exit
 ```
 
 ## Hacking
@@ -46,15 +48,17 @@ on any Python package, it is safe to be tested in-tree:
 
 ## Contributing
 
-Please make sure that patches maintain the full branch [coverage]
-and the [hobgoblins][flake8] are happy:
+Issues should be reported to [chung@loa.loang.net][loang mailing list].
+
+The mailing list also welcomes patches.  Please maintain
+the full branch [coverage] and keep the [hobgoblins][flake8] happy:
 
     PYTHONPATH=src coverage run
     coverage report
     flake8
 
-Patches should be sent to [chung@loa.loang.net][loang mailing list]
-using [`git send-email`][git send-email], with the following configuration:
+Patches should be sent using [`git send-email`][git send-email]
+with the following configuration:
 
     git config sendemail.to 'chung@loa.loang.net'
     git config format.subjectPrefix 'PATCH scadere'
@@ -63,17 +67,16 @@ using [`git send-email`][git send-email], with the following configuration:
 
 ![AGPLv3](https://www.gnu.org/graphics/agplv3-155x51.png)
 
-Scadere is free software: you can redistribute it and/or modify it
-under the terms of the GNU [Affero General Public License][agplv3] as
-published by the Free Software Foundation, either version 3 of the License,
-or (at your option) any later version.
+Scadere is free software: you can redistribute and/or modify it
+under the terms of the GNU [Affero General Public License][agpl]
+version 3 or later.
 
 [pytest]: https://docs.pytest.org
 [pytest-asyncio]: https://pytest-asyncio.rtfd.io
 [Hypothesis]: https://hypothesis.rtfd.io
 [trustme]: https://trustme.rtfd.io
+[loang mailing list]: https://loa.loang.net/chung
 [coverage]: https://coverage.rtfd.io
 [flake8]: https://flake8.pycqa.org
-[loang mailing list]: https://loa.loang.net/chung
 [git send-email]: https://git-send-email.io
-[agplv3]: https://www.gnu.org/licenses/agpl-3.0.html
+[agpl]: https://www.gnu.org/licenses/agpl
diff --git a/doc/Makefile b/doc/Makefile
new file mode 100644
index 0000000..47e8669
--- /dev/null
+++ b/doc/Makefile
@@ -0,0 +1,48 @@
+# Makefile for manual pages
+# Copyright (C) 2025  Nguyễn Gia Phong
+#
+# This file is part of scadere.
+#
+# Scadere is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published
+# by the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Scadere is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with scadere.  If not, see <https://www.gnu.org/licenses/>.
+
+.POSIX:
+.PHONY: all clean install uninstall
+
+PREFIX ?= /usr/local
+BINDIR ::= $(DESTDIR)$(PREFIX)/bin
+MANDIR ::= $(DESTDIR)$(PREFIX)/share/man
+MAN1 ::= scadere-check.1 scadere-listen.1
+MAN1FLAGS ::= -s 1 --source=Scadere --locale=en_US.UTF-8\
+	--include=common.h2m --no-info
+
+all: $(MAN1)
+
+scadere-check.1: $(BINDIR)/scadere-check check.h2m common.h2m
+	help2man --name='TLS certificate expiration checker'\
+		$(MAN1FLAGS) --include=check.h2m --output=$@ $<
+
+scadere-listen.1: $(BINDIR)/scadere-listen listen.h2m common.h2m
+	help2man --name='Atom feed server to remind of TLS certificate renewal'\
+		$(MAN1FLAGS) --include=listen.h2m --output=$@ $<
+
+clean:
+	rm -f $(MAN1)
+
+install: $(MAN:%.1=$(MANDIR)/man1/%.1)
+
+$(MANDIR)/man1/%.1: %.1
+	install -Dm 644 $< $@
+
+uninstall:
+	rm -f $(MAN:%.1=$(MANDIR)/man1/%.1)
diff --git a/doc/check.h2m b/doc/check.h2m
new file mode 100644
index 0000000..24a8bc8
--- /dev/null
+++ b/doc/check.h2m
@@ -0,0 +1,2 @@
+[see also]
+scadere-listen(1)
diff --git a/doc/common.h2m b/doc/common.h2m
new file mode 100644
index 0000000..4ec20c3
--- /dev/null
+++ b/doc/common.h2m
@@ -0,0 +1,12 @@
+[author]
+Written by Nguyễn Gia Phong.
+
+[reporting bugs]
+Issues should be reported to <chung@loa.loang.net>.
+
+[copyright]
+This is free software: you are can redistribute and/or modify it
+under the terms of the GNU Affero General Public License version 3 or later
+<https://gnu.org/licenses/agpl>.
+
+There is NO WARRANTY, to the extent permitted by law.
diff --git a/doc/listen.h2m b/doc/listen.h2m
new file mode 100644
index 0000000..ee9fa93
--- /dev/null
+++ b/doc/listen.h2m
@@ -0,0 +1,2 @@
+[see also]
+scadere-check(1)