Browse Source

Work around old /usr/bin/man problem

Actually man 1.* does support local mode, we just have to pass pathname
(with slash), which can be easily worked around by using tempfile.
Alois Mahdal 6 years ago
parent
commit
2037d66d02
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      src/bin/sfdoc

+ 5
- 5
src/bin/sfdoc View File

@@ -161,11 +161,11 @@ main() {
161 161
             ;;
162 162
         man)
163 163
             which pod2man &>/dev/null \
164
-             || die "pod2man is missing cannot use man page mode"
165
-            man --version |& grep -qF 'man 2.' \
166
-             || die "unknown \`man\` (only 2.x is supported): $(man --version 2>&1)"
167
-            sfdoc__export manpage "${RealModuleName:-$module}" "$mpath" "$encoding" \
168
-              | man -l -
164
+             || die "pod2man is missing; cannot use man page mode"
165
+            manfile=$(mktemp -t "sfdoc.manfile.XXXXXXXX")
166
+            sfdoc__export manpage "${RealModuleName:-$module}" "$mpath" "$encoding" >"$manfile"
167
+            man "$manfile"
168
+            rm "$manfile"
169 169
             ;;
170 170
         src)
171 171
             local lesspipe