2019-05-09 11:23:50 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
echo "Use: $0 page-name (with no section suffix)"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-06-26 19:30:04 +00:00
|
|
|
# make sure the rules have been regenerated (in case man/update-man-rules was just run)
|
2020-03-23 19:39:23 +00:00
|
|
|
ninja -C "@BUILD_ROOT@" version.h
|
|
|
|
|
2019-05-09 11:23:50 +00:00
|
|
|
target="man/$1.html"
|
|
|
|
ninja -C "@BUILD_ROOT@" "$target"
|
2020-08-07 16:42:22 +00:00
|
|
|
|
|
|
|
fullname="@BUILD_ROOT@/$target"
|
|
|
|
redirect="$(readlink "$fullname" 2>/dev/null)"
|
|
|
|
if [ -n "$redirect" ]; then
|
|
|
|
ninja -C "@BUILD_ROOT@" "man/$redirect"
|
|
|
|
|
|
|
|
fullname="@BUILD_ROOT@/man/$redirect"
|
|
|
|
fi
|
|
|
|
|
2019-05-09 11:23:50 +00:00
|
|
|
set -x
|
2020-08-07 16:42:22 +00:00
|
|
|
exec xdg-open "$fullname"
|