| 1 |
#!/bin/sh |
| 2 |
# SPDX-License-Identifier: LGPL-2.1-or-later |
| 3 |
|
| 4 |
set -e |
| 5 |
|
| 6 |
if [ -z "$1" ]; then |
| 7 |
echo "Use: $0 page-name (with no section suffix)" |
| 8 |
exit 1 |
| 9 |
fi |
| 10 |
|
| 11 |
# make sure the rules have been regenerated (in case update-man-rules was just run) |
| 12 |
ninja -C @BUILD_ROOT@ src/version/version.h |
| 13 |
|
| 14 |
target="man/$1.html" |
| 15 |
ninja -C @BUILD_ROOT@ "$target" |
| 16 |
|
| 17 |
fullname=@BUILD_ROOT@/"$target" |
| 18 |
if [ -f "$fullname" ]; then |
| 19 |
redirect="$(readlink "$fullname" || :)" |
| 20 |
else |
| 21 |
redirect="" |
| 22 |
fi |
| 23 |
if [ -n "$redirect" ]; then |
| 24 |
ninja -C @BUILD_ROOT@ "man/$redirect" |
| 25 |
|
| 26 |
fullname=@BUILD_ROOT@"/man/$redirect" |
| 27 |
fi |
| 28 |
|
| 29 |
set -x |
| 30 |
exec xdg-open "$fullname" |