bin/setup-man

Mon, 26 Aug 2024 14:23:43 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Mon, 26 Aug 2024 14:23:43 -0500
changeset 1177
93b5d2db30bc
parent 756
8bc91181db9d
permissions
-rwxr-xr-x

more gopls config. add inlay hint toggle

756
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
1 #!/bin/sh
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
2 set -eu
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
3
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
4 cd $(hg root)
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
5
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
6 SOURCES="${@:-$(hg stat -Aqn -I 'bin/*')}"
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
7 MAN1=".man/man1"
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
8
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
9 mkdir -p $MAN1 || true
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
10
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
11 for SRC in $(grep -El '^=(head|cut)' $SOURCES); do
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
12 DST="${MAN1}/$(basename $SRC).1"
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
13 if [ ! -f $DST ] || [ "$SRC" -nt "$SRC" ]; then
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
14 pod2man -v --errors=stderr "$SRC" "$DST"
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
15 fi
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
16 done

mercurial