]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/man.in
man: fix link markup
[thirdparty/systemd.git] / man / man.in
CommitLineData
e9bbff18
ZJS
1#!/bin/sh
2set -e
3
4if [ -z "$1" ]; then
5 echo "Use: $0 page-name (with no section suffix)"
6 exit 1
7fi
8
cb713f16 9# make sure the rules have been regenerated (in case man/update-man-rules was just run)
3919ecc5
ZJS
10ninja -C "@BUILD_ROOT@" version.h
11
90f003a3
ZJS
12page="$(echo "$1" | sed 's/\./\\./')"
13target=$(ninja -C "@BUILD_ROOT@" -t query man/man | grep -E -m1 "man/$page\.[0-9]$" | awk '{print $2}')
e9bbff18
ZJS
14if [ -z "$target" ]; then
15 echo "Cannot find page $1"
16 exit 1
17fi
18ninja -C "@BUILD_ROOT@" "$target"
4fb33411 19exec man "@BUILD_ROOT@/$target"