[m-dev.] Small patch for doc/make_manpage

Peter Hawkins peter at hawkins.emu.id.au
Mon Jun 7 22:16:10 AEST 2004


Hi...

Attached is a small patch to doc/make_manpage in the Mercury
distribution so it produces a correct .SH NAME section at the top of the
generated makefiles. A .SH NAME section is required for linux man pages
so the whatis(1) tool works correctly.

The patch is in the public domain.

=)
Peter
-------------- next part --------------
--- /home/vice/pmt/hawkinsp/pr/mercury/doc/make_manpage	Thu Oct 10 20:43:32 2002
+++ mercury/doc/make_manpage	Mon Jun  7 20:38:01 2004
@@ -65,6 +65,8 @@
 rm -f /tmp/make_manpage$$
 uppername="$name"
 
+summary="`echo \"$manpage\" | head -n 1 | cut -d ',' -f 1`"
+
 if echo "$manpage" | grep '^.SH "ARGUMENTS' > /dev/null; then
 	first_half="`echo \"$manpage\" | sed '/^.SH \"ARGUMENTS *\"/,$d'`"
 	last_half="`echo \"$manpage\" | sed -n '/^.SH \"ARGUMENTS *\"/,$p'`"
@@ -83,6 +85,9 @@
 .fi
 ..
 .TH $uppername 1 "`date`" "" "Mercury Programmer's Manual"
+.SH NAME
+$uppername \- $summary
+.SH VERSION
 .AT 3
 .Vb 2
 $first_half


More information about the developers mailing list