bin/setup-man

Fri, 12 Apr 2019 12:30:51 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Fri, 12 Apr 2019 12:30:51 -0500
changeset 757
54fdb5a6bf67
parent 756
8bc91181db9d
permissions
-rwxr-xr-x

Add vim-indent-guides

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