xref: /freebsd/contrib/ntp/sntp/ag-tpl/0-old/agman-cmd.tpl (revision 416ba5c74546f32a993436a99516d35008e9f384)
1*2b15cb3dSCy Schubert[+: -*- Mode: nroff -*-
2*2b15cb3dSCy Schubert
3*2b15cb3dSCy Schubert  AutoGen5 template man
4*2b15cb3dSCy Schubert
5*2b15cb3dSCy Schubert## agman-cmd.tpl -- Template for command line man pages
6*2b15cb3dSCy Schubert##
7*2b15cb3dSCy Schubert##  This file is part of AutoOpts, a companion to AutoGen.
8*2b15cb3dSCy Schubert##  AutoOpts is free software.
9*2b15cb3dSCy Schubert##  Copyright (C) 1992-2013 Bruce Korb - all rights reserved
10*2b15cb3dSCy Schubert##
11*2b15cb3dSCy Schubert##  AutoOpts is available under any one of two licenses.  The license
12*2b15cb3dSCy Schubert##  in use must be one of these two and the choice is under the control
13*2b15cb3dSCy Schubert##  of the user of the license.
14*2b15cb3dSCy Schubert##
15*2b15cb3dSCy Schubert##   The GNU Lesser General Public License, version 3 or later
16*2b15cb3dSCy Schubert##      See the files "COPYING.lgplv3" and "COPYING.gplv3"
17*2b15cb3dSCy Schubert##
18*2b15cb3dSCy Schubert##   The Modified Berkeley Software Distribution License
19*2b15cb3dSCy Schubert##      See the file "COPYING.mbsd"
20*2b15cb3dSCy Schubert##
21*2b15cb3dSCy Schubert##  These files have the following sha256 sums:
22*2b15cb3dSCy Schubert##
23*2b15cb3dSCy Schubert##  8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95  COPYING.gplv3
24*2b15cb3dSCy Schubert##  4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b  COPYING.lgplv3
25*2b15cb3dSCy Schubert##  13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239  COPYING.mbsd
26*2b15cb3dSCy Schubert
27*2b15cb3dSCy Schubert# Produce a man page for section 1, 5 or 8 commands.
28*2b15cb3dSCy Schubert# Which is selected via:  -DMAN_SECTION=n
29*2b15cb3dSCy Schubert# passed to the autogen invocation.  "n" may have a suffix, if desired.
30*2b15cb3dSCy Schubert#
31*2b15cb3dSCy Schubert:+][+:
32*2b15cb3dSCy Schubert
33*2b15cb3dSCy Schubert(define head-line (lambda()
34*2b15cb3dSCy Schubert        (sprintf ".TH %s %s \"%s\" \"%s\" \"%s\"\n.\\\"\n"
35*2b15cb3dSCy Schubert                (get "prog-name") man-sect
36*2b15cb3dSCy Schubert        (shell "date '+%d %b %Y'") package-text section-name) ))
37*2b15cb3dSCy Schubert
38*2b15cb3dSCy Schubert(define man-page #t)
39*2b15cb3dSCy Schubert(out-push-new)                              :+][+:
40*2b15cb3dSCy Schubert
41*2b15cb3dSCy SchubertINCLUDE "mdoc-synopsis.tlib"                :+][+:
42*2b15cb3dSCy SchubertINCLUDE "cmd-doc.tlib"                      :+][+:
43*2b15cb3dSCy Schubert
44*2b15cb3dSCy SchubertINVOKE build-doc                            :+][+:
45*2b15cb3dSCy Schubert
46*2b15cb3dSCy Schubert  (shell (string-append
47*2b15cb3dSCy Schubert    "fn='" (find-file "mdoc2man") "'\n"
48*2b15cb3dSCy Schubert    "test -f ${fn} || die mdoc2man not found from $PWD\n"
49*2b15cb3dSCy Schubert    "${fn} <<\\_EndOfMdoc_ || die ${fn} failed in $PWD\n"
50*2b15cb3dSCy Schubert    (out-pop #t)
51*2b15cb3dSCy Schubert    "\n_EndOfMdoc_" ))
52*2b15cb3dSCy Schubert
53*2b15cb3dSCy Schubert:+][+:
54*2b15cb3dSCy Schubert
55*2b15cb3dSCy Schubert(out-move (string-append (get "prog-name") "."
56*2b15cb3dSCy Schubert          man-sect))      :+][+:
57*2b15cb3dSCy Schubert
58*2b15cb3dSCy Schubertagman-cmd.tpl ends here   :+]
59