]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/ntp/sntp/ag-tpl/0-old/mdoc-synopsis.tlib
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / ntp / sntp / ag-tpl / 0-old / mdoc-synopsis.tlib
1 [+: autogen5 template man :+][+: 
2 DEFINE mk-synopsis                          :+][+:
3   (out-push-new file-name)                 \:+]
4 .Sh SYNOPSIS
5 .Nm[+:
6
7   IF (. use-flags)                          :+][+:
8     IF (exist? "long-opts")                 :+]
9 .\" Mixture of short (flag) options and long options
10 .Op Fl flags
11 .Op Fl flag Op Ar value
12 .Op Fl \-option-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
13 [+: ELSE no long options:                   :+]
14 .Op Fl flags
15 .Op Fl flag Op Ar value
16 [+: ENDIF
17                                             :+][+:
18   ELIF (exist? "long-opts")
19                                             :+]
20 .Op Fl \-option-name
21 .Op Fl \-option-name Ar value
22 [+:
23
24   ELIF  (not (exist? "argument"))           :+]
25 .Op Ar option\-name Ar value
26 .Pp
27 All arguments are named options.
28 [+:
29   ENDIF                                     :+][+:
30
31   IF (exist? "argument")                    :+][+:
32     argument                                :+][+:
33
34     IF (exist? "reorder-args")              :+]
35 .Pp
36 Operands and options may be intermixed.  They will be reordered.
37 [+: ENDIF                                   :+][+:
38
39   ELIF (or (exist? "long-opts") use-flags)
40
41 :+]
42 .Pp
43 All arguments must be options.
44 [+:
45
46   ENDIF                                     :+][+:
47
48   IF (exist? "main")                        :+][+:
49   CASE main.main-type                       :+][+:
50   == shell-process                          :+]
51 .Pp
52 This program will emit text that is expected to be evaluated by
53 a Bourne-compatible shell, thus digesting the options for the script.[+:
54
55   == shell-parser                           :+]
56 .Pp
57 This program is designed to produce output suitable for inclusion
58 into a shell script that will parse the options described.[+:
59
60   == for-each                               :+]
61 .Pp
62 The operands that this program operates on may be specified either
63 on the command line or read from standard input, one per line.
64 In that input, leading and trailing white space is stripped,
65 blank lines are ignored[+:
66
67     IF (define comment-char (get "comment-char" "#"))
68        (> (string-length comment-char) 1)  \:+]
69  and lines beginning with the character
70 .I [+: (substring comment-char 1 0):+]
71 are treated as comments[+:
72     ENDIF :+].[+:
73
74     IF (exist? "interleaved")               :+]
75 Options may be interleaved with operands both on the command
76 line and when operands are read from standard input.[+:
77     ENDIF  interleaved
78
79 :+]
80 Standard input may not be a terminal.[+:
81
82   ESAC  main-type                           :+][+:
83   ENDIF  main exists                        :+]
84 .Pp
85 [+:
86
87 FOR explain   "\n.Pp\n"                     :+][+:
88   (get "explain" "")                        :+][+:
89 ENDFOR                                      :+][+:
90
91 (out-pop)                                   :+][+:
92 ENDDEF mk-synopsis                          :+]