1 [+: autogen5 template man :+][+:
2 DEFINE mk-synopsis :+][+:
3 (out-push-new file-name) \:+]
7 IF (. use-flags) :+][+:
8 IF (exist? "long-opts") :+]
9 .\" Mixture of short (flag) options and long options
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: :+]
15 .Op Fl flag Op Ar value
18 ELIF (exist? "long-opts")
21 .Op Fl \-option-name Ar value
24 ELIF (not (exist? "argument")) :+]
25 .Op Ar option\-name Ar value
27 All arguments are named options.
31 IF (exist? "argument") :+][+:
34 IF (exist? "reorder-args") :+]
36 Operands and options may be intermixed. They will be reordered.
39 ELIF (or (exist? "long-opts") use-flags)
43 All arguments must be options.
48 IF (exist? "main") :+][+:
49 CASE main.main-type :+][+:
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.[+:
57 This program is designed to produce output suitable for inclusion
58 into a shell script that will parse the options described.[+:
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[+:
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[+:
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.[+:
80 Standard input may not be a terminal.[+:
87 FOR explain "\n.Pp\n" :+][+:
88 (get "explain" "") :+][+:
92 ENDDEF mk-synopsis :+]