1# regression tests for the ast optget() and opthelp() functions
2
3export LC_ALL=C LC_MESSAGES=C
4
5TEST 01 'compatibility'
6	EXEC	net 'a-' -a b
7		OUTPUT - $'return=a option=-a name=-a arg=(null) num=1
8argument=1 value="b"'
9	EXEC	net 'a-:' -a b
10	EXEC	net 'a-:' -a --help b
11		OUTPUT - $'return=a option=-a name=-a arg=(null) num=1
12return=- option=-- name=-- arg=help num=1
13argument=1 value="b"'
14	EXEC	cmd $'a file ...' -?
15		OUTPUT - $'return=? option=-? name=-? num=0'
16		ERROR - $'Usage: cmd [-a] file ...'
17		EXIT 2
18	EXEC	cmd $'a file ...' --??api
19		OUTPUT - $'return=? option=-? name=--??api num=0'
20		ERROR - $'.SH SYNOPSIS\ncmd [ options ] file ...\n.SH OPTIONS\n.OP a - flag -'
21	EXEC	cmd $'[ab] file' -?
22		OUTPUT - $'return=? option=-? name=-? num=0'
23		ERROR - $'Usage: cmd [ -a | -b ] file'
24	EXEC	cmd $'[ab] file' --??api
25		OUTPUT - $'return=? option=-? name=--??api num=0'
26		ERROR - $'.SH SYNOPSIS\ncmd [ options ] file\n.SH OPTIONS\n.OP - - oneof\n.OP a - flag -\n.OP b - flag -\n.OP - - anyof'
27	EXEC	cmd $'[a:b] file' -?
28		OUTPUT - $'return=? option=-? name=-? num=0'
29		ERROR - $'Usage: cmd [ -a arg | -b ] file'
30	EXEC	cmd $'[a:b] file' --??api
31		OUTPUT - $'return=? option=-? name=--??api num=0'
32		ERROR - $'.SH SYNOPSIS\ncmd [ options ] file\n.SH OPTIONS\n.OP - - oneof\n.OP a - string arg\n.OP b - flag -\n.OP - - anyof'
33	EXEC	wc $'lw[cm] [ file ... ]' -?
34		OUTPUT - $'return=? option=-? name=-? num=0'
35		ERROR - $'Usage: wc [-lw] [ -c | -m ] [ file ... ]'
36	EXEC	wc $'lw[cm] [ file ... ]' --??api
37		OUTPUT - $'return=? option=-? name=--??api num=0'
38		ERROR - $'.SH SYNOPSIS\nwc [ options ] [ file ... ]\n.SH OPTIONS\n.OP l - flag -\n.OP w - flag -\n.OP - - oneof\n.OP c - flag -\n.OP m - flag -\n.OP - - anyof'
39
40TEST 02 'long options'
41	usage=$'[-?\n@(#)testopt (AT&T Research) 1999-02-02\n][-author?Glenn Fowler <gsf@research.att.com>][--dictionary?tests:opt][x:method?One of]:?[algorithm:oneof:ignorecase]{[+a?method a][+b?method b][+c?method c]}[\n[y=10:yes?Yes.][20:no?No.]\n][d:database?File database path.]:[path][z:size?Important size.]#[sizeX][V:vernum?List program version and exit.][v:verbose?Enable verbose trace.][n:show?Show but don\'t execute.]\n\npattern ...'
42	EXEC	cmd "$usage" -y
43		OUTPUT - 'return=-10 option=-10 name=-y arg=(null) num=1'
44	EXEC	cmd "$usage" --y
45		OUTPUT - 'return=-10 option=-10 name=--yes arg=(null) num=1'
46	EXEC	cmd "$usage" -x
47		OUTPUT - 'return=x option=-x name=-x arg=(null) num=1'
48	EXEC	cmd "$usage" -xabc
49		OUTPUT - 'return=x option=-x name=-x arg=abc num=1'
50	EXEC	cmd "$usage" -x abc
51	EXEC	cmd "$usage" --method
52		OUTPUT - 'return=x option=-x name=--method arg=(null) num=1'
53	EXEC	cmd "$usage" --method=abc
54		OUTPUT - 'return=x option=-x name=--method arg=abc num=1'
55	EXEC	cmd "$usage" --method abc
56		OUTPUT - $'return=x option=-x name=--method arg=(null) num=1\nargument=1 value="abc"'
57	EXEC	cmd "$usage" -V -x --si 10k --size=1m
58		OUTPUT - $'return=V option=-V name=-V arg=(null) num=1\nreturn=x option=-x name=-x arg=(null) num=0\nreturn=z option=-z name=--size arg=10k num=10000\nreturn=z option=-z name=--size arg=1m num=1000000'
59	EXEC	cmd "$usage" -V -x --si 10ki --size=1mi
60		OUTPUT - $'return=V option=-V name=-V arg=(null) num=1\nreturn=x option=-x name=-x arg=(null) num=0\nreturn=z option=-z name=--size arg=10ki num=10240\nreturn=z option=-z name=--size arg=1mi num=1048576'
61	EXEC	cmd "$usage" --yes --no --noyes --no-yes --yes=1 --yes=0
62		OUTPUT - $'return=-10 option=-10 name=--yes arg=(null) num=1\nreturn=-20 option=-20 name=--no arg=(null) num=1\nreturn=-10 option=-10 name=--yes arg=(null) num=0\nreturn=-10 option=-10 name=--yes arg=(null) num=0\nreturn=-10 option=-10 name=--yes arg=(null) num=1\nreturn=-10 option=-10 name=--yes arg=(null) num=0'
63	EXEC	cmd "$usage" --vern
64		OUTPUT - $'return=V option=-V name=--vernum arg=(null) num=1'
65	EXEC	cmd "$usage" --ver
66		OUTPUT - $'return=: option=-V name=--ver num=0'
67		ERROR - $'cmd: --ver: ambiguous option'
68		EXIT 1
69	EXEC	cmd "$usage" --ve
70		OUTPUT - $'return=: option=-V name=--ve num=0'
71		ERROR - $'cmd: --ve: ambiguous option'
72	EXEC	cmd "$usage" --v
73		OUTPUT - $'return=: option=-V name=--v num=0'
74		ERROR - $'cmd: --v: ambiguous option'
75	EXEC	cmd "$usage" -z
76		OUTPUT - $'return=: option=-z name=-z num=0'
77		ERROR - $'cmd: -z: numeric sizeX argument expected'
78	EXEC	cmd "$usage" --size
79		OUTPUT - $'return=: option=-z name=--size num=0'
80		ERROR - $'cmd: --size: numeric sizeX value expected'
81	EXEC	cmd "$usage" --foo
82		OUTPUT - $'return=: option= name=--foo num=0 str=--foo'
83		ERROR - $'cmd: --foo: unknown option'
84	EXEC	cmd "$usage" --foo=bar
85		OUTPUT - $'return=: option= name=--foo num=0 str=--foo=bar'
86		ERROR - $'cmd: --foo: unknown option'
87	EXEC	cmd "$usage" --version
88		OUTPUT - $'return=? option=- name=--version num=0'
89		ERROR - $'  version         testopt (AT&T Research) 1999-02-02'
90		EXIT 2
91	EXEC	cmd "$usage" '--?-'
92		OUTPUT - $'return=? option=-? name=--?- num=0'
93		ERROR - $'  version         testopt (AT&T Research) 1999-02-02\n  author          Glenn Fowler <gsf@research.att.com>'
94	EXEC	cmd "$usage" '--??about'
95		OUTPUT - $'return=? option=-? name=--??about num=0'
96	EXEC	cmd "$usage" '--about'
97		OUTPUT - $'return=? option=- name=--about num=0'
98	EXEC	cmd "$usage" '--?--'
99		OUTPUT - $'return=? option=-? name=--?-- num=0'
100		ERROR - $'  version         testopt (AT&T Research) 1999-02-02\n  author          Glenn Fowler <gsf@research.att.com>\n  dictionary      tests:opt'
101	EXEC	cmd "$usage" -?
102		OUTPUT - $'return=? option=-? name=-? num=0'
103		ERROR - $'Usage: cmd [-Vvn] [-x[algorithm]] [ -y ] [-d path] [-z sizeX] pattern ...'
104	EXEC	cmd "$usage" --?
105		OUTPUT - $'return=? option=-? name=--? num=0'
106		ERROR - $'Usage: cmd [ options ] pattern ...
107OPTIONS
108  -x, --method[=algorithm]
109                  One of
110                    a     method a
111                    b     method b
112                    c     method c
113                  The option value may be omitted.
114  -y, --yes       Yes.
115  --no            No.
116  -d, --database=path
117                  File database path.
118  -z, --size=sizeX
119                  Important size.
120  -V, --vernum    List program version and exit.
121  -v, --verbose   Enable verbose trace.
122  -n, --show      Show but don\'t execute.'
123	EXEC	cmd "$usage" --??api
124		OUTPUT - $'return=? option=-? name=--??api num=0'
125		ERROR - $'.SH SYNOPSIS\ncmd [ options ] pattern ...\n.SH OPTIONS\n.OP x method string:ignorecase:oneof:optional algorithm\nOne of\n.H2 a\nmethod a\n.H2 b\nmethod b\n.H2 c\nmethod c\n.SP\nThe option value may be omitted.\n.OP - - oneof\n.OP y yes flag -\nYes.\n.OP - no flag -\nNo.\n.OP - - anyof\n.OP d database string path\nFile database path.\n.OP z size number sizeX\nImportant size.\n.OP V vernum flag -\nList program version and exit.\n.OP v verbose flag -\nEnable verbose trace.\n.OP n show flag -\nShow but don\'t execute.\n.SH IMPLEMENTATION\n.H0 version\ntestopt (AT&T Research) 1999-02-02\n.H0 author\nGlenn Fowler <gsf@research.att.com>'
126	EXEC	cmd "$usage" --?help
127		OUTPUT - $'return=? option=-? name=--?help num=0'
128		ERROR - $'Usage: cmd [ options ]
129OPTIONS
130  --help          List detailed help option info.'
131	EXEC	cmd "$usage" --??help
132		OUTPUT - $'return=? option=-? name=--??help num=0'
133		ERROR - $'NAME
134  options available to all ast commands
135
136SYNOPSIS
137  cmd [ options ]
138
139DESCRIPTION
140  -? and --?* options are the same for all ast commands. For any item below, if
141  --item is not supported by a given command then it is equivalent to --??item.
142  The --?? form should be used for portability. All output is written to the
143  standard error.
144
145OPTIONS
146  --about         List all implementation info.
147  --api           List detailed info in program readable form.
148  --help          List detailed help option info.
149  --html          List detailed info in html.
150  --keys          List the usage translation key strings with C style escapes.
151  --long          List long option usage.
152  --man           List detailed info in displayed man page form.
153  --nroff         List detailed info in nroff.
154  --options       List short and long option details.
155  --posix         List posix getopt usage.
156  --short         List short option usage.
157  --usage         List the usage string with C style escapes.
158  --?-label       List implementation info matching label*.
159  --?name         Equivalent to --help=name.
160  --?             Equivalent to --??options.
161  --??            Equivalent to --??man.
162  --???           Equivalent to --??help.
163  --???item       If the next argument is --option then list the option output
164                  in the item style. Otherwise print version=n where n>0 if
165                  --??item is supported, 0 if not.
166  --???ESC        Emit escape codes even if output is not a terminal.
167  --???MAN[=section]
168                  List the man(1) section title for section
169                  [the current command].
170  --???SECTION    List the man(1) section number for the current command.
171  --???TEST       Massage the output for regression testing.'
172	EXEC	cmd "$usage" --???
173		OUTPUT - $'return=? option=-? name=--??? num=0'
174	EXEC	cmd "$usage" --??usage
175		OUTPUT - $'return=? option=-? name=--??usage num=0'
176		ERROR - $'[-?\\n@(#)testopt (AT&T Research) 1999-02-02\\n][-author?Glenn Fowler <gsf@research.att.com>][--dictionary?tests:opt][x:method?One of]:?[algorithm:oneof:ignorecase]{[+a?method a][+b?method b][+c?method c]}[\\n[y=10:yes?Yes.][20:no?No.]\\n][d:database?File database path.]:[path][z:size?Important size.]#[sizeX][V:vernum?List program version and exit.][v:verbose?Enable verbose trace.][n:show?Show but don\\\'t execute.]\\n\\npattern ...'
177	EXEC	head $'[-n?\n@(#)$Id: head (AT&T Research) 2010-04-22 $\n][-author?bozo]' --version
178		OUTPUT - $'return=? option=- name=--version num=0'
179		ERROR - $'  version         head (AT&T Research) 2010-04-22'
180
181TEST 03 'info callback'
182	usage=$'[+][x:method?One of \fmethods\f.]:?[algorithm][m:meta?Enable metachars.]\n\npattern ...'
183	EXEC	cmd "$usage" --?met
184		OUTPUT - $'return=? option=-? name=--?met num=0'
185		ERROR - $'Usage: cmd [ options ] pattern ...
186OPTIONS
187  -x, --method[=algorithm]
188                  One of <* methods info ok *>. The option value may be
189                  omitted.
190  -m, --meta      Enable metachars.'
191		EXIT 2
192	usage=$'[-][+NAME?stty][a:aaa?AAA][z:zzz?ZZZ]:[path][+\fone\f?\ftwo\f]{[+?\fthree\f]}'
193	EXEC	cmd "$usage" --man
194		OUTPUT - $'return=? option=- name=--man num=0'
195		ERROR - $'NAME
196  stty
197
198SYNOPSIS
199  stty [ options ]
200
201OPTIONS
202  -a, --aaa       AAA
203  -z, --zzz=path  ZZZ
204
205<* one info ok *>
206  <* two info ok *>
207          <* three info ok *>'
208	usage=$'[-][+NAME?stty][z:zzz?ZZZ]:[path]{\fzero\f}[a:aaa?AAA][+\fone\f?\ftwo\f]{[+?\fthree\f]}'
209	EXEC	cmd "$usage" --man
210		ERROR - $'NAME
211  stty
212
213SYNOPSIS
214  stty [ options ]
215
216OPTIONS
217  -z, --zzz=path  ZZZ
218                    yabba dabba
219                    doo   aroni
220  -a, --aaa       AAA
221
222<* one info ok *>
223  <* two info ok *>
224          <* three info ok *>'
225	usage=$'[-][+NAME?aha - just do it][+DESCRIPTION?Bla bla.]{\fzero\f}\n\n[ dialect ]\n\n[+SEE ALSO?Bla.]'
226	EXEC aha "$usage" --man
227		OUTPUT - $'return=? option=- name=--man num=0'
228		ERROR - $'NAME
229  aha - just do it
230
231SYNOPSIS
232  aha [ options ] [ dialect ]
233
234DESCRIPTION
235  Bla bla.
236    yabba dabba
237    doo   aroni
238
239SEE ALSO
240  Bla.'
241	usage=$'[-][+NAME?aha - just do it][+DESCRIPTION?Bla bla.]{[+before?insert]\fzero\f[+after?append]}'
242	EXEC	aha "$usage" --man
243		OUTPUT - $'return=? option=- name=--man num=0'
244		ERROR - $'NAME
245  aha - just do it
246
247SYNOPSIS
248  aha [ options ]
249
250DESCRIPTION
251  Bla bla.
252    before
253          insert
254    yabba dabba
255    doo   aroni
256    after append'
257	usage=$'[-][+NAME?aha - just do it][+DESCRIPTION?Bla bla.][o]:?[option?bla bla bla:]{[+before?insert]\fzero\f[+after?append]}'
258	EXEC	aha "$usage" --man
259		ERROR - $'NAME
260  aha - just do it
261
262SYNOPSIS
263  aha [ options ]
264
265DESCRIPTION
266  Bla bla.
267
268OPTIONS
269  -o[option]      bla bla bla:
270                    before
271                          insert
272                    yabba dabba
273                    doo   aroni
274                    after append
275                  The option value may be omitted.'
276	usage=$'[-][+NAME?Color_t - Color enum type][+Color_t?Values are \fmore#5\f.  The default value is \fmore#6\f.]'
277	EXEC	Color_t "$usage" --man
278		ERROR - $'NAME
279  Color_t - Color enum type
280
281SYNOPSIS
282  Color_t [ options ]
283
284Color_t
285  Values are red, orange, yellow, green, blue, indigo, violet. The default
286  value is red.'
287
288TEST 04 'oh man'
289	usage=$'
290	[-?@(#)sum (AT&T Research) 1999-01-23\n]
291	[-author?Glenn Fowler <gsf@research.att.com>]
292	[-author?David Korn <dgk@research.att.com>]
293	[-copyright?Copyright (c) 1989-1999 AT&T Corp.]
294	[-license?http://www.research.att.com/sw/license/ast-open.html]
295	[+NAME?\f?\f - write file checksums and sizes]
296	[+DESCRIPTION?\b\f?\f\b calculates and writes to the standard
297		output a checksum and the number of bytes in each file.
298		Alternate algorithms can be specified as an option.
299		The default algorithm is POSIX CRC.]
300	[+?This should start another paragraph under DESCRIPTION.]
301	[v:v*erbose?List verbose information on the algorithm. This
302		can get really long and really wordy.]
303	[V:vernum?List the program version and exit.]
304	[a:each?List sum for each file when used with --total.]
305	[l:file-list?Each file is a list of file names to sum.]
306	[r:recursive?Recursively sum the files in directories.]
307	[10:furby?Use fuzzy logic.]
308	[t:total?Print the sum of the concatenation of all files.]
309	[m:magic?Magic incantation.]#?[yyxzy]
310	[x:algorithm|method?The checksum algorithm to apply.]:
311		[algorithm:=att:oneof:ignorecase]
312		{
313			[+att|sys5|s5?The traditional system 5 sum.]
314			{
315				[+one?Test sub sub 1.]
316				[+two?Test sub sub 2.]
317			}
318			[+ast?The ast pseudo-random number generator sum.]
319			[+md5?The message digest checksum.]
320		}
321	[:woo?Short test 0.]:[junk-0]
322	[A?Short test 1.]:[junk-1]
323	[B:?Short test 2.]:[junk-2]
324	[C:junk?Short test 3.]:[junk-3]
325	[D:?Short test 4.]:[junk-4]
326	[E]:[junk-5]
327	[F:]:[junk-6]
328	[G?]:[junk-7]
329	[H:?]:[junk-8]
330	[Q:test?Enable test code -- could be buggy.]
331
332	file file
333	file [ ... dir ]
334
335	[+STANDARD OUTPUT FORMAT?"%u %d %s\\n" <\achecksum\a> <\apathname\a>]
336	[+?If no \afile\a operand is specified, the pathname and its leading
337		space are omitted.]
338	[+FILES?These files are referenced whether [you]] like it [or not.]]]
339	{
340		[+lib/file/magic?Magic number table.]
341		[+lib/find/find.codes?Fast find database.]
342	}
343	[+JUNK]
344	{
345		[+lib/file/magic?Magic number table.]
346		[+lib/locate/locate.db?GNU fast find database.]
347	}
348	[+AND ALSO MORE JUNK TOO?First paragraph.]
349	[+?Next paragraph.]
350'
351	EXEC	sum "$usage" '-?'
352		EXIT 2
353		OUTPUT - $'return=? option=-? name=-? num=0'
354		ERROR - $'Usage: sum [-vValrtQ] [-m[yyxzy]] [-x algorithm] [-A junk-1] [-B junk-2]
355           [-C junk-3] [-D junk-4] [-E junk-5] [-F junk-6] [-G junk-7]
356           [-H junk-8] file file
357   Or: sum [ options ] file [ ... dir ]'
358	EXEC	sum "$usage" '--?'
359		OUTPUT - $'return=? option=-? name=--? num=0'
360		ERROR - $'Usage: sum [ options ] file file
361   Or: sum [ options ] file [ ... dir ]
362OPTIONS
363  -v, --v*erbose  List verbose information on the algorithm. This can get
364                  really long and really wordy.
365  -V, --vernum    List the program version and exit.
366  -a, --each      List sum for each file when used with --total.
367  -l, --file-list Each file is a list of file names to sum.
368  -r, --recursive Recursively sum the files in directories.
369  --furby         Use fuzzy logic.
370  -t, --total     Print the sum of the concatenation of all files.
371  -m, --magic[=yyxzy]
372                  Magic incantation. The option value may be omitted.
373  -x, --algorithm|method=algorithm
374                  The checksum algorithm to apply.
375                    att|sys5|s5
376                          The traditional system 5 sum.
377                            one   Test sub sub 1.
378                            two   Test sub sub 2.
379                    ast   The ast pseudo-random number generator sum.
380                    md5   The message digest checksum.
381                  The default value is att.
382  --woo=junk-0    Short test 0.
383  -A junk-1       Short test 1.
384  -B junk-2       Short test 2.
385  -C, --junk=junk-3
386                  Short test 3.
387  -D junk-4       Short test 4.
388  -E junk-5
389  -F junk-6
390  -G junk-7
391  -H junk-8
392  -Q, --test      Enable test code -- could be buggy.'
393	EXEC	sum "$usage" '--??'
394		OUTPUT - $'return=? option=-? name=--?? num=0'
395		ERROR - $'NAME
396  sum - write file checksums and sizes
397
398SYNOPSIS
399  sum [ options ] file file
400  sum [ options ] file [ ... dir ]
401
402DESCRIPTION
403  sum calculates and writes to the standard output a checksum and the number of
404  bytes in each file. Alternate algorithms can be specified as an option. The
405  default algorithm is POSIX CRC.
406
407  This should start another paragraph under DESCRIPTION.
408
409OPTIONS
410  -v, --v*erbose  List verbose information on the algorithm. This can get
411                  really long and really wordy.
412  -V, --vernum    List the program version and exit.
413  -a, --each      List sum for each file when used with --total.
414  -l, --file-list Each file is a list of file names to sum.
415  -r, --recursive Recursively sum the files in directories.
416  --furby         Use fuzzy logic.
417  -t, --total     Print the sum of the concatenation of all files.
418  -m, --magic[=yyxzy]
419                  Magic incantation. The option value may be omitted.
420  -x, --algorithm|method=algorithm
421                  The checksum algorithm to apply.
422                    att|sys5|s5
423                          The traditional system 5 sum.
424                            one   Test sub sub 1.
425                            two   Test sub sub 2.
426                    ast   The ast pseudo-random number generator sum.
427                    md5   The message digest checksum.
428                  The default value is att.
429  --woo=junk-0    Short test 0.
430  -A junk-1       Short test 1.
431  -B junk-2       Short test 2.
432  -C, --junk=junk-3
433                  Short test 3.
434  -D junk-4       Short test 4.
435  -E junk-5
436  -F junk-6
437  -G junk-7
438  -H junk-8
439  -Q, --test      Enable test code -- could be buggy.
440
441STANDARD OUTPUT FORMAT
442  "%u %d %s\\n" <checksum> <pathname>
443
444  If no file operand is specified, the pathname and its leading space are
445  omitted.
446
447FILES
448  These files are referenced whether [you] like it [or not.]
449    lib/file/magic
450          Magic number table.
451    lib/find/find.codes
452          Fast find database.
453
454JUNK
455    lib/file/magic
456          Magic number table.
457    lib/locate/locate.db
458          GNU fast find database.
459
460AND ALSO MORE JUNK TOO
461  First paragraph.
462
463  Next paragraph.
464
465IMPLEMENTATION
466  version         sum (AT&T Research) 1999-01-23
467  author          Glenn Fowler <gsf@research.att.com>
468  author          David Korn <dgk@research.att.com>
469  copyright       Copyright (c) 1989-1999 AT&T Corp.
470  license         http://www.research.att.com/sw/license/ast-open.html'
471	EXEC	sum "$usage" '--?' -
472		OUTPUT - $'return=? option=-? name=--? num=0'
473		ERROR - $'  version         sum (AT&T Research) 1999-01-23
474  author          Glenn Fowler <gsf@research.att.com>
475  author          David Korn <dgk@research.att.com>
476  copyright       Copyright (c) 1989-1999 AT&T Corp.
477  license         http://www.research.att.com/sw/license/ast-open.html'
478	EXEC	sum "$usage" '--?' -ver
479		OUTPUT - $'return=? option=-? name=--? num=0'
480		ERROR - $'  version         sum (AT&T Research) 1999-01-23'
481	EXEC	sum "$usage" '--?' -copyright
482		OUTPUT - $'return=? option=-? name=--? num=0'
483		ERROR - $'  copyright       Copyright (c) 1989-1999 AT&T Corp.'
484	EXEC	sum "$usage" '--?' -license
485		OUTPUT - $'return=? option=-? name=--? num=0'
486		ERROR - $'  license         http://www.research.att.com/sw/license/ast-open.html'
487	EXEC	sum "$usage" '--?' -author
488		OUTPUT - $'return=? option=-? name=--? num=0'
489		ERROR - $'  author          Glenn Fowler <gsf@research.att.com>
490  author          David Korn <dgk@research.att.com>'
491	EXEC	sum "$usage" '--?' -foo
492		EXIT 1
493		OUTPUT - $'return=: option=-? name=--? num=0'
494		ERROR - $'sum: -foo: unknown option'
495	EXEC	sum "$usage" -m A
496		ERROR -
497		OUTPUT - $'return=m option=-m name=-m arg=(null) num=0\nargument=1 value="A"'
498		EXIT 0
499	EXEC	sum "$usage" -m L A
500		OUTPUT - $'return=m option=-m name=-m arg=(null) num=0\nargument=1 value="L"\nargument=2 value="A"'
501	EXEC	sum "$usage" -m 0 A
502		OUTPUT - $'return=m option=-m name=-m arg=0 num=0\nargument=1 value="A"'
503
504TEST 05 'should at least generate its own man page'
505	usage=$'[-?@(#)getopts (AT&T Research) 1999-02-02\n]
506[+NAME?\f?\f - parse utility options]
507[a:command]:[name?Use \aname\a instead of the command name in usage messages.]
508
509opstring name [args...]
510
511[+DESCRIPTION?The \bgetopts\b utility can be used to retrieve options and
512arguments from a list of arguments give by \aargs\a or the positional
513parameters if \aargs\a is omitted.  It can also generate usage messages
514and a man page for the command based on the information in \aoptstring\a.]
515[+?The \aoptstring\a string consists of alpha-numeric characters,
516the special characters +, -, ?, :, and <space>, or character groups
517enclosed in [...]].  Character groups may be nested in {...}.
518Outside of a [...]] group, a single new-line followed by zero or
519more blanks is ignored.  One or more blank lines separates the
520options from the command argument synopsis.]
521[+?Each [...]] group consists of an optional label,
522optional attributes separated by :, and an
523optional description string following ?.  The characters from the ?
524to the end of the next ]] are ignored for option parsing and short
525usage messages.  They are used for generating verbose help or man pages.
526The : character may not appear in the label.
527The ? character must be specified as ?? in label and the ]] character
528must be specified as ]]]] in the description string.
529Text between two \\b (backspace) characters indicates
530that the text should be emboldened when displayed.
531Text between two \\a (bell) characters indicates that the text should
532be emphasised or italicised when displayed.]
533[+?There are four types of groups:]
534{
535	[+1.?An option specifiation of the form \aoption\a:\alongname\a.
536	In this case the first field is the option character.  If there
537	is no option character, then a two digit number should be specified
538	that corresponds to the long options.  This negative of this number
539	will be returned as the value of \aname\a by \bgetopts\b if the long
540	option is matched. A longname is matched with \b--\b\alongname\a.  A
541	* in the \alongname\a field indicates that only characters up that
542	point need to match provided any additional characters match the option.
543	The [ and ]] can be omitted for options that don\'t have longnames
544	or descriptive text.]
545	[+2.?A string option argument specification.
546	Options that take arguments can be followed by : or # and an option
547	group specification.  An option group specification consists
548	of a name for the option argument as field 1.   The remaining
549	fields are a typename and zero or more of the special attribute words
550	\blistof\b, \boneof\b, and \bignorecase\b.
551	The option specification can be followed
552	by a list of option value descriptions enclosed in parenthesis.]
553	[+3.?A option value description.]
554	[+4.?A argument specification. A list of valid option argument values
555		can be specified by enclosing them inside a {...} following
556		the option argument specification.  Each of the permitted
557		values can be specified with a [...]] containing the
558		value followed by a description.]
559}
560[+?If the leading character of \aoptstring\a is +, then arguments
561beginning with + will also be considered options.]
562[+?A leading : character or a : following a leading + in \aoptstring\a
563affects the way errors are handled.  If an option character or longname
564argument not specified in \aoptstring\a is encountered when processing
565options, the shell variable whose name is \aname\a will be set to the ?
566character.  The shell variable \bOPTARG\b will be set to
567the character found.  If an option argument is missing or has an invalid
568value, then \aname\a will be set to the : character and the shell variable
569\bOPTARG\b will be set to the option character found.
570Without the leading :, \aname\a will be set to the ? character, \bOPTARG\b
571will be unset, and an error message will be written to standard error
572when errors are encountered.]
573[+?The end of options occurs when:]
574{
575	[+1.?The special argument \b--\b.]
576	[+2.?An argument that does not beging with a \b-\b.]
577	[+3.?A help argument is specified.]
578	[+4.?An error is encountered.]
579}
580[+?If \bOPTARG\b is set to the value \b1\b, a new set of arguments
581can be used.]
582[+?\bgetopts\b can also be used to generate help messages containing command
583usage and detailed descriptions.  Specify \aargs\a as:]
584{
585	[+-???To generate a usage synopsis.]
586	[+--?????To generate a verbose usage message.]
587	[+--????man?To generate a formatted man page.]
588	[+--????api?To generate an easy to parse usage message.]
589	[+--????html?To generate a man page in \bhtml\b format.]
590}
591[+?When the end of options is encountered, \bgetopts\b exits with a
592non-zero return value and the variable \bOPTIND\b is set to the
593index of the first non-option argument.]
594[+EXIT STATUS]
595{
596	[+0?An option specified was found.]
597	[+1?An end of options was encountered.]
598	[+2?A usage or information message was generated.]
599}
600'
601	getopts_usage=$usage
602	EXEC	getopts "$usage" '-?'
603		EXIT 2
604		OUTPUT - $'return=? option=-? name=-? num=0'
605		ERROR - $'Usage: getopts [-a name] opstring name [args...]'
606	EXEC	getopts "$usage" '--?'
607		OUTPUT - $'return=? option=-? name=--? num=0'
608		ERROR - $'Usage: getopts [ options ] opstring name [args...]
609OPTIONS
610  -a, --command=name
611                  Use name instead of the command name in usage messages.'
612	EXEC	getopts "$usage" '--??'
613		OUTPUT - $'return=? option=-? name=--?? num=0'
614		ERROR - $'NAME
615  getopts - parse utility options
616
617SYNOPSIS
618  getopts [ options ] opstring name [args...]
619
620OPTIONS
621  -a, --command=name
622                  Use name instead of the command name in usage messages.
623
624DESCRIPTION
625  The getopts utility can be used to retrieve options and arguments from a list
626  of arguments give by args or the positional parameters if args is omitted. It
627  can also generate usage messages and a man page for the command based on the
628  information in optstring.
629
630  The optstring string consists of alpha-numeric characters, the special
631  characters +, -, ?, :, and <space>, or character groups enclosed in [...].
632  Character groups may be nested in {...}. Outside of a [...] group, a single
633  new-line followed by zero or more blanks is ignored. One or more blank lines
634  separates the options from the command argument synopsis.
635
636  Each [...] group consists of an optional label, optional attributes separated
637  by :, and an optional description string following ?. The characters from the
638  ? to the end of the next ] are ignored for option parsing and short usage
639  messages. They are used for generating verbose help or man pages. The :
640  character may not appear in the label. The ? character must be specified as
641  ?? in label and the ] character must be specified as ]] in the description
642  string. Text between two \\b (backspace) characters indicates that the text
643  should be emboldened when displayed. Text between two \\a (bell) characters
644  indicates that the text should be emphasised or italicised when displayed.
645
646  There are four types of groups:
647    1.    An option specifiation of the form option:longname. In this case the
648          first field is the option character. If there is no option character,
649          then a two digit number should be specified that corresponds to the
650          long options. This negative of this number will be returned as the
651          value of name by getopts if the long option is matched. A longname is
652          matched with --longname. A * in the longname field indicates that
653          only characters up that point need to match provided any additional
654          characters match the option. The [ and ] can be omitted for options
655          that don\'t have longnames or descriptive text.
656    2.    A string option argument specification. Options that take arguments
657          can be followed by : or # and an option group specification. An
658          option group specification consists of a name for the option argument
659          as field 1. The remaining fields are a typename and zero or more of
660          the special attribute words listof, oneof, and ignorecase. The option
661          specification can be followed by a list of option value descriptions
662          enclosed in parenthesis.
663    3.    A option value description.
664    4.    A argument specification. A list of valid option argument values can
665          be specified by enclosing them inside a {...} following the option
666          argument specification. Each of the permitted values can be specified
667          with a [...] containing the value followed by a description.
668
669  If the leading character of optstring is +, then arguments beginning with +
670  will also be considered options.
671
672  A leading : character or a : following a leading + in optstring affects the
673  way errors are handled. If an option character or longname argument not
674  specified in optstring is encountered when processing options, the shell
675  variable whose name is name will be set to the ? character. The shell
676  variable OPTARG will be set to the character found. If an option argument is
677  missing or has an invalid value, then name will be set to the : character and
678  the shell variable OPTARG will be set to the option character found. Without
679  the leading :, name will be set to the ? character, OPTARG will be unset, and
680  an error message will be written to standard error when errors are
681  encountered.
682
683  The end of options occurs when:
684    1.    The special argument --.
685    2.    An argument that does not beging with a -.
686    3.    A help argument is specified.
687    4.    An error is encountered.
688
689  If OPTARG is set to the value 1, a new set of arguments can be used.
690
691  getopts can also be used to generate help messages containing command usage
692  and detailed descriptions. Specify args as:
693    -?    To generate a usage synopsis.
694    --??  To generate a verbose usage message.
695    --??man
696          To generate a formatted man page.
697    --??api
698          To generate an easy to parse usage message.
699    --??html
700          To generate a man page in html format.
701
702  When the end of options is encountered, getopts exits with a non-zero return
703  value and the variable OPTIND is set to the index of the first non-option
704  argument.
705
706EXIT STATUS
707    0     An option specified was found.
708    1     An end of options was encountered.
709    2     A usage or information message was generated.
710
711IMPLEMENTATION
712  version         getopts (AT&T Research) 1999-02-02'
713	EXEC	getopts "$usage" '--??api'
714		OUTPUT - $'return=? option=-? name=--??api num=0'
715		ERROR - $'.SH NAME
716getopts - parse utility options
717.SH SYNOPSIS
718getopts [ options ] opstring name [args...]
719.SH OPTIONS
720.OP a command string name
721Use name instead of the command name in usage messages.
722.SH DESCRIPTION
723The getopts utility can be used to retrieve options and arguments from a list of arguments give by args or the positional parameters if args is omitted. It can also generate usage messages and a man page for the command based on the information in optstring.
724.PP
725The optstring string consists of alpha-numeric characters, the special characters +, -, ?, :, and <space>, or character groups enclosed in [...]. Character groups may be nested in {...}. Outside of a [...] group, a single new-line followed by zero or more blanks is ignored. One or more blank lines separates the options from the command argument synopsis.
726.PP
727Each [...] group consists of an optional label, optional attributes separated by :, and an optional description string following ?. The characters from the ? to the end of the next ] are ignored for option parsing and short usage messages. They are used for generating verbose help or man pages. The : character may not appear in the label. The ? character must be specified as ?? in label and the ] character must be specified as ]] in the description string. Text between two \\b (backspace) characters indicates that the text should be emboldened when displayed. Text between two \\a (bell) characters indicates that the text should be emphasised or italicised when displayed.
728.PP
729There are four types of groups:
730.H1 1.
731An option specifiation of the form option:longname. In this case the first field is the option character. If there is no option character, then a two digit number should be specified that corresponds to the long options. This negative of this number will be returned as the value of name by getopts if the long option is matched. A longname is matched with --longname. A * in the longname field indicates that only characters up that point need to match provided any additional characters match the option. The [ and ] can be omitted for options that don\'t have longnames or descriptive text.
732.H1 2.
733A string option argument specification. Options that take arguments can be followed by : or # and an option group specification. An option group specification consists of a name for the option argument as field 1. The remaining fields are a typename and zero or more of the special attribute words listof, oneof, and ignorecase. The option specification can be followed by a list of option value descriptions enclosed in parenthesis.
734.H1 3.
735A option value description.
736.H1 4.
737A argument specification. A list of valid option argument values can be specified by enclosing them inside a {...} following the option argument specification. Each of the permitted values can be specified with a [...] containing the value followed by a description.
738.PP
739If the leading character of optstring is +, then arguments beginning with + will also be considered options.
740.PP
741A leading : character or a : following a leading + in optstring affects the way errors are handled. If an option character or longname argument not specified in optstring is encountered when processing options, the shell variable whose name is name will be set to the ? character. The shell variable OPTARG will be set to the character found. If an option argument is missing or has an invalid value, then name will be set to the : character and the shell variable OPTARG will be set to the option character found. Without the leading :, name will be set to the ? character, OPTARG will be unset, and an error message will be written to standard error when errors are encountered.
742.PP
743The end of options occurs when:
744.H1 1.
745The special argument --.
746.H1 2.
747An argument that does not beging with a -.
748.H1 3.
749A help argument is specified.
750.H1 4.
751An error is encountered.
752.PP
753If OPTARG is set to the value 1, a new set of arguments can be used.
754.PP
755getopts can also be used to generate help messages containing command usage and detailed descriptions. Specify args as:
756.H1 -?
757To generate a usage synopsis.
758.H1 --??
759To generate a verbose usage message.
760.H1 --??man
761To generate a formatted man page.
762.H1 --??api
763To generate an easy to parse usage message.
764.H1 --??html
765To generate a man page in html format.
766.PP
767When the end of options is encountered, getopts exits with a non-zero return value and the variable OPTIND is set to the index of the first non-option argument.
768.SH EXIT STATUS
769.H1 0
770An option specified was found.
771.H1 1
772An end of options was encountered.
773.H1 2
774A usage or information message was generated.
775.SH IMPLEMENTATION
776.H0 version
777getopts (AT&T Research) 1999-02-02'
778	EXEC	getopts "$usage" '--??html'
779		OUTPUT - $'return=? option=-? name=--??html num=0'
780		ERROR - $'<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
781<HTML>
782<HEAD>
783<META name="generator" content="optget (AT&T Research) 2011-11-11">
784<TITLE>getopts man document</TITLE>
785<STYLE type="text/css">
786div.SH { padding-left:2em; text-indent:0em; }
787div.SY { padding-left:4em; text-indent:-2em; }
788dt { float:left; clear:both; }
789dd { margin-left:3em; }
790</STYLE>
791</HEAD>
792<BODY bgcolor=white>
793<H4><TABLE width=100%><TR><TH align=left>GETOPTS&nbsp;(&nbsp;1&nbsp;)&nbsp;<TH align=center><A href="." title="Index">USER COMMANDS</A><TH align=right>GETOPTS&nbsp;(&nbsp;1&nbsp;)</TR></TABLE></H4>
794<HR>
795<H4><A name="NAME">NAME</A></H4>
796<DIV class=SH>
797<!--MAN-INDEX-->getopts - parse utility options
798<P>
799</DIV>
800<H4><A name="SYNOPSIS">SYNOPSIS</A></H4>
801<DIV class=SY>
802<B>getopts</B> &#0091; <I>options</I> &#0093; opstring name &#0091;args...&#0093;
803<P>
804</DIV>
805<H4><A name="OPTIONS">OPTIONS</A></H4>
806<DIV class=SH>
807<DL>
808<DT>-<B>a</B>, --<B>command</B>=<I>name</I><DD><BR>Use <I>name</I> instead of the
809command name in usage messages.
810</DL>
811</DIV>
812<H4><A name="DESCRIPTION">DESCRIPTION</A></H4>
813<DIV class=SH>
814The <B>getopts</B> utility can be used to retrieve options and arguments from a
815list of arguments give by <I>args</I> or the positional parameters if <I>args
816</I> is omitted. It can also generate usage messages and a man page for the
817command based on the information in <I>optstring</I>.
818<P>
819The <I>optstring</I> string consists of alpha-numeric characters, the special
820characters +, -, ?, :, and &lt;space&gt;, or character groups enclosed in
821&#0091;...&#0093;. Character groups may be nested in {...}. Outside of a &#0091;...&#0093; group, a
822single new-line followed by zero or more blanks is ignored. One or more blank
823lines separates the options from the command argument synopsis.
824<P>
825Each &#0091;...&#0093; group consists of an optional label, optional attributes separated
826by :, and an optional description string following ?. The characters from the ?
827to the end of the next &#0093; are ignored for option parsing and short usage
828messages. They are used for generating verbose help or man pages. The :
829character may not appear in the label. The ? character must be specified as ??
830in label and the &#0093; character must be specified as &#0093;&#0093; in the description string.
831Text between two \\b (backspace) characters indicates that the text should be
832emboldened when displayed. Text between two \\a (bell) characters indicates that
833the text should be emphasised or italicised when displayed.
834<P>
835There are four types of groups:
836<DL>
837<DT><A name="1."><B>1.</B></A><DD>An option specifiation of the form <I>option</I>:
838<I>longname</I>. In this case the first field is the option character. If there
839is no option character, then a two digit number should be specified that
840corresponds to the long options. This negative of this number will be returned
841as the value of <I>name</I> by <B>getopts</B> if the long option is matched. A
842longname is matched with <B>--</B><I>longname</I>. A * in the <I>longname</I>
843field indicates that only characters up that point need to match provided any
844additional characters match the option. The &#0091; and &#0093; can be omitted for options
845that don\'t have longnames or descriptive text.
846<DT><A name="2."><B>2.</B></A><DD>A string option argument specification. Options
847that take arguments can be followed by : or # and an option group
848specification. An option group specification consists of a name for the option
849argument as field 1. The remaining fields are a typename and zero or more of
850the special attribute words <B>listof</B>, <B>oneof</B>, and <B>ignorecase</B>.
851The option specification can be followed by a list of option value descriptions
852enclosed in parenthesis.
853<DT><A name="3."><B>3.</B></A><DD>A option value description.
854<DT><A name="4."><B>4.</B></A><DD>A argument specification. A list of valid option
855argument values can be specified by enclosing them inside a {...} following the
856option argument specification. Each of the permitted values can be specified
857with a &#0091;...&#0093; containing the value followed by a description.
858<P>
859</DL>
860If the leading character of <I>optstring</I> is +, then arguments beginning
861with + will also be considered options.
862<P>
863A leading : character or a : following a leading + in <I>optstring</I> affects
864the way errors are handled. If an option character or longname argument not
865specified in <I>optstring</I> is encountered when processing options, the shell
866variable whose name is <I>name</I> will be set to the ? character. The shell
867variable <B>OPTARG</B> will be set to the character found. If an option
868argument is missing or has an invalid value, then <I>name</I> will be set to
869the : character and the shell variable <B>OPTARG</B> will be set to the option
870character found. Without the leading :, <I>name</I> will be set to the ?
871character, <B>OPTARG</B> will be unset, and an error message will be written to
872standard error when errors are encountered.
873<P>
874The end of options occurs when:
875<DL>
876<DT><A name="1."><B>1.</B></A><DD>The special argument <B>--</B>.
877<DT><A name="2."><B>2.</B></A><DD>An argument that does not beging with a <B>-</B>.
878<DT><A name="3."><B>3.</B></A><DD>A help argument is specified.
879<DT><A name="4."><B>4.</B></A><DD>An error is encountered.
880<P>
881</DL>
882If <B>OPTARG</B> is set to the value <B>1</B>, a new set of arguments can be
883used.
884<P>
885<B>getopts</B> can also be used to generate help messages containing command
886usage and detailed descriptions. Specify <I>args</I> as:
887<DL>
888<DT><A name="-?"><B>-?</B></A><DD>To generate a usage synopsis.
889<DT><A name="--??"><B>--??</B></A><DD>To generate a verbose usage message.
890<DT><A name="--??man"><B>--??man</B></A><DD><BR>To generate a formatted man page.
891<DT><A name="--??api"><B>--??api</B></A><DD><BR>To generate an easy to parse usage
892message.
893<DT><A name="--??html"><B>--??html</B></A><DD><BR>To generate a man page in <B>html
894</B> format.
895<P>
896</DL>
897When the end of options is encountered, <B>getopts</B> exits with a non-zero
898return value and the variable <B>OPTIND</B> is set to the index of the first
899non-option argument.
900</DIV>
901<H4><A name="EXIT STATUS">EXIT STATUS</A></H4>
902<DIV class=SH>
903<DL>
904<DT><A name="0"><B>0</B></A><DD>An option specified was found.
905<DT><A name="1"><B>1</B></A><DD>An end of options was encountered.
906<DT><A name="2"><B>2</B></A><DD>A usage or information message was generated.
907</DL>
908</DIV>
909<H4><A name="IMPLEMENTATION">IMPLEMENTATION</A></H4>
910<DIV class=SH>
911<DL>
912<DT><A name="version"><B>version</B></A><DD><BR>getopts (AT&amp;T Research)
9131999-02-02
914</DL>
915</DIV>
916</BODY>
917</HTML>'
918	EXEC	getopts "$usage" '--version'
919		OUTPUT - $'return=? option=- name=--version num=0'
920		ERROR - $'  version         getopts (AT&T Research) 1999-02-02'
921	usage=$'[-][a:aaa?AAA]:[delimiter:=\\::][b:bbb?BBB]:[string:=??][c]:[ccc:==??::=]'
922	EXEC	tooalso "$usage" --man
923		OUTPUT - $'return=? option=- name=--man num=0'
924		ERROR - $'SYNOPSIS
925  tooalso [ options ]
926
927OPTIONS
928  -a, --aaa=delimiter
929                  AAA The default value is \\:.
930  -b, --bbb=string
931                  BBB The default value is ?.
932  -c ccc The default value is =?:=.'
933
934TEST 06 'bugs of omission'
935	usage=$'[-][+NAME?locate][a:again?Look again.][b:noback?Don\'t look back.][n:notnow?Don\'t look now.][t:twice?Look twice.][+FOO]{[+foo?aha]}[+BAR?bahah]'
936	EXEC	locate "$usage" '-?'
937		EXIT 2
938		OUTPUT - $'return=? option=-? name=-? num=0'
939		ERROR - $'Usage: locate [-abnt]'
940	EXEC	locate "$usage" '--?'
941		OUTPUT - $'return=? option=-? name=--? num=0'
942		ERROR - $'Usage: locate [ options ]
943OPTIONS
944  -a, --again     Look again.
945  -b, --noback    Don\'t look back.
946  -n, --notnow    Don\'t look now.
947  -t, --twice     Look twice.'
948	EXEC	locate "$usage" '--man'
949		OUTPUT - $'return=? option=- name=--man num=0'
950		ERROR - $'NAME
951  locate
952
953SYNOPSIS
954  locate [ options ]
955
956OPTIONS
957  -a, --again     Look again.
958  -b, --noback    Don\'t look back.
959  -n, --notnow    Don\'t look now.
960  -t, --twice     Look twice.
961
962FOO
963    foo   aha
964
965BAR
966  bahah'
967
968TEST 07 'return value tests'
969	usage=$'[-][a=1111:aaa]\t[b=2:bbb]\t[=3:ccc][44:ddd][i!:iii][j!:jjj?Yada yada.]'
970	EXEC tst "$usage" -a
971		OUTPUT - $'return=-1111 option=-1111 name=-a arg=(null) num=1'
972	EXEC tst "$usage" --a
973		OUTPUT - $'return=-1111 option=-1111 name=--aaa arg=(null) num=1'
974	EXEC tst "$usage" -b
975		OUTPUT - $'return=-2 option=-2 name=-b arg=(null) num=1'
976	EXEC tst "$usage" --b
977		OUTPUT - $'return=-2 option=-2 name=--bbb arg=(null) num=1'
978	EXEC tst "$usage" --c
979		OUTPUT - $'return=-3 option=-3 name=--ccc arg=(null) num=1'
980	EXEC tst "$usage" --d
981		OUTPUT - $'return=-44 option=-44 name=--ddd arg=(null) num=1'
982	EXEC tst "$usage" -a -b --a --b --c --d -i --i --noi
983		OUTPUT - $'return=-1111 option=-1111 name=-a arg=(null) num=1
984return=-2 option=-2 name=-b arg=(null) num=1
985return=-1111 option=-1111 name=--aaa arg=(null) num=1
986return=-2 option=-2 name=--bbb arg=(null) num=1
987return=-3 option=-3 name=--ccc arg=(null) num=1
988return=-44 option=-44 name=--ddd arg=(null) num=1
989return=i option=-i name=-i arg=(null) num=0
990return=i option=-i name=--iii arg=(null) num=1
991return=i option=-i name=--iii arg=(null) num=0'
992	EXEC tst "$usage" '-?'
993		EXIT 2
994		OUTPUT - $'return=? option=-? name=-? num=0'
995		ERROR - $'Usage: tst [-abij]'
996	EXEC tst "$usage" '--?'
997		OUTPUT - $'return=? option=-? name=--? num=0'
998		ERROR - $'Usage: tst [ options ]\nOPTIONS\n  -a, --aaa\n  -b, --bbb\n  --ccc\n  --ddd\n  -i, --iii\n  -j, --jjj       Yada yada. On by default; -j means --nojjj.'
999	EXEC tst "$usage" '--??api'
1000		OUTPUT - $'return=? option=-? name=--??api num=0'
1001		ERROR - $'.SH SYNOPSIS
1002tst [ options ]
1003.SH OPTIONS
1004.OP a aaa flag -
1005.OP b bbb flag -
1006.OP - ccc flag -
1007.OP - ddd flag -
1008.OP i iii flag:invert -
1009.OP j jjj flag:invert -
1010Yada yada.
1011 On by default; -j means --nojjj.
1012.SH IMPLEMENTATION
1013.SP'
1014
1015TEST 08 'optstr() tests'
1016	usage=$'[-][a:aaa?AAA][v:vvv?VVV]:[xxx]'
1017	EXEC	- dll "$usage" 'vvv=zzz foo: aaa bar: aaa'
1018		OUTPUT - $'return=v option=-v name=vvv arg=zzz num=1
1019return=# option=: name=foo arg=(null) num=0
1020return=a option=-a name=aaa arg=(null) num=1
1021return=# option=: name=bar arg=(null) num=0
1022return=a option=-a name=aaa arg=(null) num=1'
1023	EXEC	- dll "$usage" '???TEST,???NOEMPHASIS,man'
1024		EXIT 2
1025		OUTPUT - $'return=? option=-? name=man num=0'
1026		ERROR - $'SYNOPSIS
1027  dll [ options ]
1028
1029OPTIONS
1030  -a, --aaa       AAA
1031  -v, --vvv=xxx   VVV'
1032	usage=$'[-?@(#)pax (AT&T Research) 1999-02-14\n]
1033[a:append?Append to end of archive.]
1034[101:atime?Preserve or set access time.]:?[time]
1035[z:base?Delta base archive name. - ignores base on input, compresses on output.]:[archive]
1036[b:blocksize?Input/output block size. The default is format specific.]#[size]
1037[102:blok?Input/output BLOK format for tapes on file.]:?[i|o]
1038[103:charset|codeset?Header data character set name.]:[name]
1039
1040[ file ... ]
1041
1042[-author?Glenn Fowler <gsf@research.att.com>]
1043[-license?http://www.research.att.com/sw/tools/reuse]
1044'
1045	EXEC	- pax "$usage" 'append base="aaa zzz" charset=us'
1046		EXIT 0
1047		OUTPUT - $'return=a option=-a name=append arg=(null) num=1
1048return=z option=-z name=base arg=aaa zzz num=1
1049return=-103 option=-103 name=charset arg=us num=1'
1050		ERROR -
1051	EXEC	- pax "$usage" '--append --base="aaa zzz" --charset=us'
1052	EXEC	- pax "$usage" '-a -zaaa'
1053		OUTPUT - $'return=a option=-a name=-a arg=(null) num=1
1054return=z option=-z name=-z arg=aaa num=1'
1055
1056	EXEC	- pax "$usage" 'app,base=aaa\,zzz,ch:=us\ ascii,block+=77777777777'
1057		OUTPUT - $'return=a option=-a name=append arg=(null) num=1
1058return=z option=-z name=base arg=aaa,zzz num=1
1059return=-103 option=-103 name=charset arg:=us ascii num=1
1060return=b option=-b name=blocksize arg+=77777777777 num=77777777777'
1061	EXEC	- pax "$usage" $'6 app\n16 base=aaa,zzz\n21 charset:=us ascii\n22 block+=77777777777\n'
1062	EXEC	- pax "$usage" $'6 app\n16 base=aaa,zzz\n21 charset:=us ascii\n22 block+=77777777777'
1063	EXEC	- pax "$usage" '--app,--base=aaa\,zzz,--ch:=us\ ascii,--block+=77777777777'
1064	EXEC	- pax "$usage" '-a,-zaaa,-b77777777777'
1065		OUTPUT - $'return=a option=-a name=-a arg=(null) num=1
1066return=z option=-z name=-z arg=aaa num=1
1067return=b option=-b name=-b arg=77777777777 num=77777777777'
1068
1069	EXEC	- pax "$usage" 'app,base=aaa\,zzz,ch:=us\ ascii,block+=077777777777'
1070		OUTPUT - $'return=a option=-a name=append arg=(null) num=1
1071return=z option=-z name=base arg=aaa,zzz num=1
1072return=-103 option=-103 name=charset arg:=us ascii num=1
1073return=b option=-b name=blocksize arg+=077777777777 num=77777777777'
1074	EXEC	- pax "$usage" $'6 app\n16 base=aaa,zzz\n21 charset:=us ascii\n23 block+=077777777777\n'
1075	EXEC	- pax "$usage" $'6 app\n16 base=aaa,zzz\n21 charset:=us ascii\n23 block+=077777777777'
1076	EXEC	- pax "$usage" '--app,--base=aaa\,zzz,--ch:=us\ ascii,--block+=077777777777'
1077	EXEC	- pax "$usage" '-a,-zaaa,-b077777777777'
1078		OUTPUT - $'return=a option=-a name=-a arg=(null) num=1
1079return=z option=-z name=-z arg=aaa num=1
1080return=b option=-b name=-b arg=077777777777 num=77777777777'
1081
1082	EXEC	- pax "$usage" 'app,base=aaa\,zzz,ch:=us\ ascii,block+=8#77777777777'
1083		OUTPUT - $'return=a option=-a name=append arg=(null) num=1
1084return=z option=-z name=base arg=aaa,zzz num=1
1085return=-103 option=-103 name=charset arg:=us ascii num=1
1086return=b option=-b name=blocksize arg+=8#77777777777 num=8589934591'
1087	EXEC	- pax "$usage" $'6 app\n16 base=aaa,zzz\n21 charset:=us ascii\n24 block+=8#77777777777\n'
1088	EXEC	- pax "$usage" $'6 app\n16 base=aaa,zzz\n21 charset:=us ascii\n24 block+=8#77777777777'
1089	EXEC	- pax "$usage" '--app,--base=aaa\,zzz,--ch:=us\ ascii,--block+=8#77777777777'
1090	EXEC	- pax "$usage" '-a,-zaaa,-b8#77777777777'
1091		OUTPUT - $'return=a option=-a name=-a arg=(null) num=1
1092return=z option=-z name=-z arg=aaa num=1
1093return=b option=-b name=-b arg=8#77777777777 num=8589934591'
1094
1095	EXEC	- pax "$usage" 'app,base=aaa\,zzz,ch:=us\ ascii,block+=0x77777777777'
1096		OUTPUT - $'return=a option=-a name=append arg=(null) num=1
1097return=z option=-z name=base arg=aaa,zzz num=1
1098return=-103 option=-103 name=charset arg:=us ascii num=1
1099return=b option=-b name=blocksize arg+=0x77777777777 num=8209686820727'
1100	EXEC	- pax "$usage" $'6 app\n16 base=aaa,zzz\n21 charset:=us ascii\n24 block+=0x77777777777\n'
1101	EXEC	- pax "$usage" $'6 app\n16 base=aaa,zzz\n21 charset:=us ascii\n24 block+=0x77777777777'
1102	EXEC	- pax "$usage" '--app,--base=aaa\,zzz,--ch:=us\ ascii,--block+=0x77777777777'
1103	EXEC	- pax "$usage" '-a,-zaaa,-b0x77777777777'
1104		OUTPUT - $'return=a option=-a name=-a arg=(null) num=1
1105return=z option=-z name=-z arg=aaa num=1
1106return=b option=-b name=-b arg=0x77777777777 num=8209686820727'
1107
1108	EXEC	- pax "$usage" 'app,base=aaa\,zzz,ch:=us\ ascii,block+=16#77777777777'
1109		OUTPUT - $'return=a option=-a name=append arg=(null) num=1
1110return=z option=-z name=base arg=aaa,zzz num=1
1111return=-103 option=-103 name=charset arg:=us ascii num=1
1112return=b option=-b name=blocksize arg+=16#77777777777 num=8209686820727'
1113	EXEC	- pax "$usage" $'6 app\n16 base=aaa,zzz\n21 charset:=us ascii\n25 block+=16#77777777777\n'
1114	EXEC	- pax "$usage" $'6 app\n16 base=aaa,zzz\n21 charset:=us ascii\n25 block+=16#77777777777'
1115	EXEC	- pax "$usage" '--app,--base=aaa\,zzz,--ch:=us\ ascii,--block+=16#77777777777'
1116	EXEC	- pax "$usage" '-a,-zaaa,-b16#77777777777'
1117		OUTPUT - $'return=a option=-a name=-a arg=(null) num=1
1118return=z option=-z name=-z arg=aaa num=1
1119return=b option=-b name=-b arg=16#77777777777 num=8209686820727'
1120
1121	EXEC	- pax "$usage" '14 foo'
1122		EXIT 1
1123		OUTPUT - $'return=: option= name=14 num=0 str=14 foo\nreturn=: option= name=foo num=0 str=14 foo'
1124		ERROR - $'pax: 14: unknown option\npax: foo: unknown option'
1125
1126TEST 09 'hidden options'
1127	usage=$'ab?cd [ file ... ]'
1128	EXEC tst "$usage" -a -b -c -d
1129		OUTPUT - $'return=a option=-a name=-a arg=(null) num=1
1130return=b option=-b name=-b arg=(null) num=1
1131return=c option=-c name=-c arg=(null) num=1
1132return=d option=-d name=-d arg=(null) num=1'
1133	EXEC tst "$usage" -?
1134		EXIT 2
1135		OUTPUT - $'return=? option=-? name=-? num=0'
1136		ERROR - $'Usage: tst [-ab] [ file ... ]'
1137	EXEC tst "$usage" --?
1138		OUTPUT - $'return=? option=-? name=--? num=0'
1139	EXEC tst "$usage" --api
1140		OUTPUT - $'return=? option=- name=--api num=0'
1141		ERROR - $'.SH SYNOPSIS
1142tst [ options ] [ file ... ]
1143.SH OPTIONS
1144.OP a - flag -
1145.OP b - flag -
1146.OP c - flag:hidden -
1147.OP d - flag:hidden -'
1148	usage=$'ab:[arg]?c'
1149	EXEC tst "$usage" -a -b z -c
1150		EXIT 0
1151		OUTPUT - $'return=a option=-a name=-a arg=(null) num=1
1152return=b option=-b name=-b arg=z num=1
1153return=c option=-c name=-c arg=(null) num=1'
1154		ERROR -
1155	EXEC tst "$usage" -?
1156		EXIT 2
1157		OUTPUT - $'return=? option=-? name=-? num=0'
1158		ERROR - $'Usage: tst [-a] [-b arg]'
1159	EXEC tst "$usage" --?
1160		OUTPUT - $'return=? option=-? name=--? num=0'
1161	EXEC tst "$usage" --api
1162		OUTPUT - $'return=? option=- name=--api num=0'
1163		ERROR - $'.SH SYNOPSIS
1164tst [ options ]
1165.SH OPTIONS
1166.OP a - flag -
1167.OP b - string arg
1168.OP c - flag:hidden -'
1169
1170TEST 10 'numeric options'
1171	new=$'[-n][b:ignoreblanks][K:oldkey?Obsolete]#[old-key]'
1172	alt=$'[-n][b:ignoreblanks][K|X:oldkey?Obsolete]#[old-key]'
1173	old=$'bK#[old-key]'
1174	EXEC sort "$new" -1 +2 file
1175		OUTPUT - $'return=K option=-K name=-1 arg=1 num=1\nreturn=K option=+K name=+2 arg=2 num=2\nargument=1 value="file"'
1176	EXEC sort "$alt" -1 +2 file
1177	EXEC sort "$old" -1 +2 file
1178		OUTPUT - $'return=: option= name=-1 num=0 str=bK#[old-key]\nargument=1 value="+2"\nargument=2 value="file"'
1179		ERROR - $'sort: -1: unknown option'
1180		EXIT 1
1181
1182	usage=$'[-][x:trace?Trace.][m:max?Max.]#[num]'
1183	EXEC set "$usage" -x
1184		OUTPUT - $'return=x option=-x name=-x arg=(null) num=1'
1185		ERROR -
1186		EXIT 0
1187	EXEC set "$usage" +x
1188		OUTPUT - $'argument=1 value="+x"'
1189	EXEC set "$usage" -4
1190		OUTPUT - $'return=: option= name=-4 num=0 str=[-][x:trace?Trace.][m:max?Max.]#[num]'
1191		ERROR - $'set: -4: unknown option'
1192		EXIT 1
1193	EXEC set "$usage" +4
1194		OUTPUT - $'argument=1 value="+4"'
1195		ERROR -
1196		EXIT 0
1197
1198	usage=$'+[-][x:trace?Trace.][m:max?Max.]#[num]'
1199	EXEC set "$usage" -x
1200		OUTPUT - $'return=x option=-x name=-x arg=(null) num=1'
1201	EXEC set "$usage" +x
1202		OUTPUT - $'return=x option=+x name=+x arg=(null) num=1'
1203		ERROR -
1204	EXEC set "$usage" -4
1205		OUTPUT - $'return=: option= name=-4 num=0 str=+[-][x:trace?Trace.][m:max?Max.]#[num]'
1206		ERROR - $'set: -4: unknown option'
1207		EXIT 1
1208	EXEC set "$usage" +4
1209		OUTPUT - $'return=: option= name=+4 num=0 str=+[-][x:trace?Trace.][m:max?Max.]#[num]'
1210		ERROR - $'set: +4: unknown option'
1211
1212	usage=$'[-+][x:trace?Trace.][m:max?Max.]#[num]'
1213	EXEC set "$usage" -x
1214		OUTPUT - $'return=x option=-x name=-x arg=(null) num=1'
1215		ERROR -
1216		EXIT 0
1217	EXEC set "$usage" +x
1218		OUTPUT - $'return=x option=+x name=+x arg=(null) num=1'
1219	EXEC set "$usage" -4
1220		OUTPUT - $'return=: option= name=-4 num=0 str=[-+][x:trace?Trace.][m:max?Max.]#[num]'
1221		ERROR - $'set: -4: unknown option'
1222		EXIT 1
1223	EXEC set "$usage" +4
1224		OUTPUT - $'return=: option= name=+4 num=0 str=[-+][x:trace?Trace.][m:max?Max.]#[num]'
1225		ERROR - $'set: +4: unknown option'
1226
1227	usage=$'+[-n][x:trace?Trace.][m:max?Max.]#[num]'
1228	EXEC set "$usage" -x
1229		OUTPUT - $'return=x option=-x name=-x arg=(null) num=1'
1230		ERROR -
1231		EXIT 0
1232	EXEC set "$usage" +x
1233		OUTPUT - $'return=x option=+x name=+x arg=(null) num=1'
1234	EXEC set "$usage" -4
1235		OUTPUT - $'return=m option=-m name=-4 arg=4 num=4'
1236	EXEC set "$usage" +4
1237		OUTPUT - $'return=m option=+m name=+4 arg=4 num=4'
1238
1239	usage=$'[-+n][x:trace?Trace.][m:max?Max.]#[num]'
1240	EXEC set "$usage" -x
1241		OUTPUT - $'return=x option=-x name=-x arg=(null) num=1'
1242		ERROR -
1243		EXIT 0
1244	EXEC set "$usage" +x
1245		OUTPUT - $'return=x option=+x name=+x arg=(null) num=1'
1246	EXEC set "$usage" -4
1247		OUTPUT - $'return=m option=-m name=-4 arg=4 num=4'
1248	EXEC set "$usage" +4
1249		OUTPUT - $'return=m option=+m name=+4 arg=4 num=4'
1250
1251TEST 11 'find style!'
1252	find=$'[-1p1?@(#)find (AT&T Research) 2010-04-22][+NAME?\bfind\b - find files][13:amin?File was last accessed \aminutes\a minutes ago.]#[minutes][17:chop?Chop leading \b./\b from printed pathnames.]\n\n[ path ... ] [ option ]\n\n[+SEE ALSO?cpio(1), file(1), ls(1), sh(1), test(1), tw(1), stat(2)]'
1253	EXEC	find "$find" -amin 1 -chop
1254		OUTPUT - $'return=-13 option=-13 name=-amin arg=1 num=1\nreturn=-17 option=-17 name=-chop arg=(null) num=1'
1255	EXEC	find "$find" -amin=1 --chop
1256	EXEC	find "$find" --amin 1 --chop
1257	EXEC	find "$find" -amin
1258		OUTPUT - $'return=: option=-13 name=-amin num=0'
1259		ERROR - $'find: -amin: numeric minutes value expected'
1260		EXIT 1
1261	EXEC	find "$find" -foo
1262		OUTPUT - $'return=: option= name=-foo num=0 str=-foo'
1263		ERROR - $'find: -foo: unknown option'
1264	EXEC	find "$find" --foo
1265		OUTPUT - $'return=: option= name=-foo num=0 str=--foo'
1266		ERROR - $'find: -foo: unknown option'
1267	EXEC	find "$find" -foo=bar
1268		OUTPUT - $'return=: option= name=-foo num=0 str=-foo=bar'
1269		ERROR - $'find: -foo: unknown option'
1270	EXEC	find "$find" --foo=bar
1271		OUTPUT - $'return=: option= name=-foo num=0 str=--foo=bar'
1272		ERROR - $'find: -foo: unknown option'
1273	EXEC	find "$find" -?
1274		OUTPUT - $'return=? option=-? name=-? num=0'
1275		ERROR - $'Usage: find [-amin minutes] [-chop] [ path ... ] [ option ]'
1276		EXIT 2
1277	EXEC	find "$find" --?
1278		ERROR - $'Usage: find [ options ] [ path ... ] [ option ]\nOPTIONS\n  -amin minutes   File was last accessed minutes minutes ago.\n  -chop           Chop leading ./ from printed pathnames.'
1279	EXEC	find "$find" --man
1280		OUTPUT - $'return=? option=- name=-man num=0'
1281		ERROR - $'NAME\n  find - find files\n\nSYNOPSIS\n  find [ options ] [ path ... ] [ option ]\n\nOPTIONS\n  -amin minutes   File was last accessed minutes minutes ago.\n  -chop           Chop leading ./ from printed pathnames.\n\nSEE ALSO\n  cpio(1), file(1), ls(1), sh(1), test(1), tw(1), stat(2)\n\nIMPLEMENTATION\n  version         find (AT&T Research) 2010-04-22'
1282	EXEC	find "$find" --nroff
1283		OUTPUT - $'return=? option=- name=-nroff num=0'
1284		ERROR - $'.\\" format with nroff|troff|groff -man
1285.TH FIND 1 2010-04-22
1286.fp 5 CW
1287.nr mH 5
1288.de H0
1289.nr mH 0
1290.in 5n
1291\\fB\\\\$1\\fP
1292.in 7n
1293..
1294.de H1
1295.nr mH 1
1296.in 7n
1297\\fB\\\\$1\\fP
1298.in 9n
1299..
1300.de H2
1301.nr mH 2
1302.in 11n
1303\\fB\\\\$1\\fP
1304.in 13n
1305..
1306.de H3
1307.nr mH 3
1308.in 15n
1309\\fB\\\\$1\\fP
1310.in 17n
1311..
1312.de H4
1313.nr mH 4
1314.in 19n
1315\\fB\\\\$1\\fP
1316.in 21n
1317..
1318.de OP
1319.nr mH 0
1320.ie !\'\\\\$1\'-\' \\{
1321.ds mO \\\\fB\\\\-\\\\$1\\\\fP
1322.ds mS ,\\\\0
1323.\\}
1324.el \\{
1325.ds mO \\\\&
1326.ds mS \\\\&
1327.\\}
1328.ie \'\\\\$2\'-\' \\{
1329.if !\'\\\\$4\'-\' .as mO \\\\0\\\\fI\\\\$4\\\\fP
1330.\\}
1331.el \\{
1332.as mO \\\\*(mS\\\\fB\\\\-\\\\$2\\\\fP
1333.if !\'\\\\$4\'-\' .as mO =\\\\fI\\\\$4\\\\fP
1334.\\}
1335.in 5n
1336\\\\*(mO
1337.in 9n
1338..
1339.de SP
1340.if \\\\n(mH==2 .in 9n
1341.if \\\\n(mH==3 .in 13n
1342.if \\\\n(mH==4 .in 17n
1343..
1344.de FN
1345.nr mH 0
1346.in 5n
1347\\\\$1 \\\\$2
1348.in 9n
1349..
1350.de DS
1351.in +3n
1352.ft 5
1353.nf
1354..
1355.de DE
1356.fi
1357.ft R
1358.in -3n
1359..
1360.SH NAME
1361\\fBfind\\fP \\- find files
1362.SH SYNOPSIS
1363\\fBfind\\fP\\ [\\ \\fIoptions\\fP\\ ]\\ [\\ path\\ \\&.\\&.\\&.\\ ]\\ [\\ option\\ ]
1364.SH OPTIONS
1365.OP - amin number minutes
1366File was last accessed \\fIminutes\\fP minutes ago\\&.
1367.OP - chop flag -
1368Chop leading \\fB\\&./\\fP from printed pathnames\\&.
1369.SH SEE\\ ALSO
1370cpio(1), file(1), ls(1), sh(1), test(1), tw(1), stat(2)
1371.SH IMPLEMENTATION
1372.H0 version
1373find (AT&T Research) 2010\\-04\\-22'
1374
1375TEST 12 'dd style!'
1376	dd=$'[-1p0][+NAME?\bdd\b - copy and convert file][10:if?Input file name.]:[file][11:conv?Conversion option.]:[conversion][+SEE ALSO?cp(1), pax(1), tr(1), seek(2)]'
1377	EXEC	dd "$dd" if=foo conv=ascii
1378		OUTPUT - $'return=-10 option=-10 name=if arg=foo num=1\nreturn=-11 option=-11 name=conv arg=ascii num=1'
1379	EXEC	dd "$dd" if foo conv ascii
1380	EXEC	dd "$dd" -if=foo --conv=ascii
1381	EXEC	dd "$dd" if
1382		OUTPUT - $'return=: option=-10 name=if num=0'
1383		ERROR - $'dd: if: file argument expected'
1384		EXIT 1
1385	EXEC	dd "$dd" --if=bar foo
1386		OUTPUT - $'return=-10 option=-10 name=if arg=bar num=1\nreturn=: option= name=foo num=0 str=foo'
1387		ERROR - $'dd: foo: unknown option'
1388	EXEC	dd "$dd" -foo
1389		OUTPUT - $'return=: option= name=foo num=0 str=-foo'
1390	EXEC	dd "$dd" --foo
1391		OUTPUT - $'return=: option= name=foo num=0 str=--foo'
1392	EXEC	dd "$dd" foo=bar
1393		OUTPUT - $'return=: option= name=foo num=0 str=foo=bar'
1394	EXEC	dd "$dd" -foo=bar
1395		OUTPUT - $'return=: option= name=foo num=0 str=-foo=bar'
1396	EXEC	dd "$dd" --foo=bar
1397		OUTPUT - $'return=: option= name=foo num=0 str=--foo=bar'
1398	EXEC	dd "$dd" -?
1399		OUTPUT - $'return=? option=-? name=-? num=0'
1400		ERROR - $'Usage: dd [if=file] [conv=conversion]'
1401		EXIT 2
1402	EXEC	dd "$dd" --?
1403		OUTPUT - $'return=? option=-? name=? num=0'
1404		ERROR - $'Usage: dd [ options ]\nOPTIONS\n  if=file         Input file name.\n  conv=conversion Conversion option.'
1405	EXEC	dd "$dd" --man
1406		OUTPUT - $'return=? option=- name=man num=0'
1407		ERROR - $'NAME\n  dd - copy and convert file\n\nSYNOPSIS\n  dd [ options ]\n\nOPTIONS\n  if=file         Input file name.\n  conv=conversion Conversion option.\n\nSEE ALSO\n  cp(1), pax(1), tr(1), seek(2)'
1408
1409TEST 13 'unknown options'
1410	usage=$'[-][l:library]:[dll][G!:gzip] [ file ]'
1411	EXEC	pzip "$usage" --library=mps --checksum --nogzip data.db
1412		OUTPUT - $'return=l option=-l name=--library arg=mps num=1\nreturn=: option= name=--checksum num=0 str=--checksum\nreturn=G option=-G name=--gzip arg=(null) num=0\nargument=1 value="data.db"'
1413		ERROR - $'pzip: --checksum: unknown option'
1414		EXIT 1
1415	EXEC	pzip "$usage" --library=mps --checksum=1 --nogzip data.db
1416		OUTPUT - $'return=l option=-l name=--library arg=mps num=1\nreturn=: option= name=--checksum num=0 str=--checksum=1\nreturn=G option=-G name=--gzip arg=(null) num=0\nargument=1 value="data.db"'
1417	EXEC	pzip "$usage" --library=mps --nochecksum --nogzip data.db
1418		OUTPUT - $'return=l option=-l name=--library arg=mps num=1\nreturn=: option= name=--nochecksum num=0 str=--nochecksum\nreturn=G option=-G name=--gzip arg=(null) num=0\nargument=1 value="data.db"'
1419		ERROR - $'pzip: --nochecksum: unknown option'
1420
1421TEST 14 'interface queries'
1422	usage=$'[-][l:library]:[dll][G!:gzip] [ file ]'
1423	EXEC	command "$usage" --???api
1424		OUTPUT - $'return=? option=-? name=--???api num=0'
1425		ERROR - $'version=1'
1426		EXIT 2
1427	EXEC	command "$usage" --???html
1428		OUTPUT - $'return=? option=-? name=--???html num=0'
1429	EXEC	command "$usage" --???man
1430		OUTPUT - $'return=? option=-? name=--???man num=0'
1431	usage=$'[-p2][l:library]:[dll][G!:gzip] [ file ]'
1432	EXEC	command "$usage" --???api
1433		OUTPUT - $'return=? option=-? name=--???api num=0'
1434		ERROR - $'version=1'
1435		EXIT 2
1436	usage=$'[-2p2][l:library]:[dll][G!:gzip] [ file ]'
1437	EXEC	command "$usage" --???api
1438		OUTPUT - $'return=? option=-? name=--???api num=0'
1439		ERROR - $'version=2'
1440		EXIT 2
1441	usage=$'l:[dll]G [ file ]'
1442	EXEC	command "$usage" --???api
1443		OUTPUT - $'return=? option=-? name=--???api num=0'
1444		ERROR - $'version=0'
1445		EXIT 2
1446	EXEC	command "$usage" --???html
1447		OUTPUT - $'return=? option=-? name=--???html num=0'
1448	EXEC	command "$usage" --???man
1449		OUTPUT - $'return=? option=-? name=--???man num=0'
1450	EXEC	command "$usage" --???MAN=3S
1451		OUTPUT - $'return=? option=-? name=--???MAN num=0'
1452		ERROR - $'STANDARD I/O FUNCTIONS'
1453
1454TEST 15 'required vs. optional arguments'
1455	usage=$'[-][r:required]:[value][o:optional]:?[value][2:aha]'
1456	EXEC	cmd "$usage" --req=1 --req -2 --req 3 4 5
1457		OUTPUT - $'return=r option=-r name=--required arg=1 num=1\nreturn=r option=-r name=--required arg=-2 num=1\nreturn=r option=-r name=--required arg=3 num=1\nargument=1 value="4"\nargument=2 value="5"'
1458	EXEC	cmd "$usage" -r1 -r -2 -r 3 4 5
1459		OUTPUT - $'return=r option=-r name=-r arg=1 num=1\nreturn=r option=-r name=-r arg=-2 num=1\nreturn=r option=-r name=-r arg=3 num=1\nargument=1 value="4"\nargument=2 value="5"'
1460	EXEC	cmd "$usage" --opt=1 --opt -2 --opt 3 4 5
1461		OUTPUT - $'return=o option=-o name=--optional arg=1 num=1\nreturn=o option=-o name=--optional arg=(null) num=1\nreturn=2 option=-2 name=-2 arg=(null) num=1\nreturn=o option=-o name=--optional arg=(null) num=1\nargument=1 value="3"\nargument=2 value="4"\nargument=3 value="5"'
1462	EXEC	cmd "$usage" -o1 -o -2 -o 3 4 5
1463		OUTPUT - $'return=o option=-o name=-o arg=1 num=1\nreturn=o option=-o name=-o arg=(null) num=0\nreturn=2 option=-2 name=-2 arg=(null) num=1\nreturn=o option=-o name=-o arg=3 num=1\nargument=1 value="4"\nargument=2 value="5"'
1464	usage=$'[-][y:sort?sort by key]:?[key]{[a?A]}'
1465	EXEC	ls "$usage" -y
1466		OUTPUT - $'return=y option=-y name=-y arg=(null) num=1'
1467
1468TEST 16 'detailed man'
1469	usage=$'[-][+NAME?ah][+DESCRIPTION?\abla\a does bla and bla. The blas are:]{[+\aaha\a?bla bla aha][+\bbwaha?not bold][+bold?yes it is]}[+?Next paragraph]{[+aaa?aaa][+bbb?bbb]}'
1470	EXEC	cmd "$usage" --html
1471		OUTPUT - $'return=? option=- name=--html num=0'
1472		ERROR - $'<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
1473<HTML>
1474<HEAD>
1475<META name="generator" content="optget (AT&T Research) 2011-11-11">
1476<TITLE>ah man document</TITLE>
1477<STYLE type="text/css">
1478div.SH { padding-left:2em; text-indent:0em; }
1479div.SY { padding-left:4em; text-indent:-2em; }
1480dt { float:left; clear:both; }
1481dd { margin-left:3em; }
1482</STYLE>
1483</HEAD>
1484<BODY bgcolor=white>
1485<H4><TABLE width=100%><TR><TH align=left>AH&nbsp;(&nbsp;1&nbsp;)&nbsp;<TH align=center><A href="." title="Index">USER COMMANDS</A><TH align=right>AH&nbsp;(&nbsp;1&nbsp;)</TR></TABLE></H4>
1486<HR>
1487<H4><A name="NAME">NAME</A></H4>
1488<DIV class=SH>
1489<!--MAN-INDEX-->ah
1490<P>
1491</DIV>
1492<H4><A name="SYNOPSIS">SYNOPSIS</A></H4>
1493<DIV class=SY>
1494<B>ah</B> &#0091; <I>options</I> &#0093;
1495</DIV>
1496<H4><A name="DESCRIPTION">DESCRIPTION</A></H4>
1497<DIV class=SH>
1498<I>bla</I> does bla and bla. The blas are:
1499<DL>
1500<DT><A name="aha"><I>aha</I></A><DD>bla bla aha
1501<DT><A name="bwaha">bwaha</A><DD><BR>not bold
1502<DT><A name="bold"><B>bold</B></A><DD>yes it is
1503<P>
1504</DL>
1505Next paragraph
1506<DL>
1507<DT><A name="aaa"><B>aaa</B></A><DD>aaa
1508<DT><A name="bbb"><B>bbb</B></A><DD>bbb
1509</DL>
1510</DIV>
1511</BODY>
1512</HTML>'
1513		EXIT 2
1514
1515TEST 17 'literal : ? ] makess you ssee double'
1516	usage=$'[-][a:aha?magic\\sesame]:[yyzzy][x?foo]:[bar]{[+a[b::c[d[,e]]]]??f[::g]]]]?A?B:C[]]][+p \'d\' "q"?duh]}[z:zoom]'
1517	EXEC	zwei "$usage" -a o
1518		OUTPUT - $'return=a option=-a name=-a arg=o num=1'
1519	EXEC	zwei "$usage" -?
1520		OUTPUT - $'return=? option=-? name=-? num=0'
1521		ERROR - $'Usage: zwei [-z] [-a yyzzy] [-x bar]'
1522		EXIT 2
1523	EXEC	zwei "$usage" --api
1524		OUTPUT - $'return=? option=- name=--api num=0'
1525		ERROR - $'.SH SYNOPSIS
1526zwei [ options ]
1527.SH OPTIONS
1528.OP a aha string yyzzy
1529magic\\sesame
1530.OP x - string bar
1531foo
1532.H2 a[b:c[d[,e]]?f[:g]]
1533A?B:C[]
1534.H2 p \'d\' "q"
1535duh
1536.OP z zoom flag -
1537.SH IMPLEMENTATION
1538.SP'
1539	EXEC	zwei "$usage" --nroff
1540		OUTPUT - $'return=? option=- name=--nroff num=0'
1541		ERROR - $'.\\" format with nroff|troff|groff -man
1542.TH ZWEI 1
1543.fp 5 CW
1544.nr mH 5
1545.de H0
1546.nr mH 0
1547.in 5n
1548\\fB\\\\$1\\fP
1549.in 7n
1550..
1551.de H1
1552.nr mH 1
1553.in 7n
1554\\fB\\\\$1\\fP
1555.in 9n
1556..
1557.de H2
1558.nr mH 2
1559.in 11n
1560\\fB\\\\$1\\fP
1561.in 13n
1562..
1563.de H3
1564.nr mH 3
1565.in 15n
1566\\fB\\\\$1\\fP
1567.in 17n
1568..
1569.de H4
1570.nr mH 4
1571.in 19n
1572\\fB\\\\$1\\fP
1573.in 21n
1574..
1575.de OP
1576.nr mH 0
1577.ie !\'\\\\$1\'-\' \\{
1578.ds mO \\\\fB\\\\-\\\\$1\\\\fP
1579.ds mS ,\\\\0
1580.\\}
1581.el \\{
1582.ds mO \\\\&
1583.ds mS \\\\&
1584.\\}
1585.ie \'\\\\$2\'-\' \\{
1586.if !\'\\\\$4\'-\' .as mO \\\\0\\\\fI\\\\$4\\\\fP
1587.\\}
1588.el \\{
1589.as mO \\\\*(mS\\\\fB\\\\-\\\\-\\\\$2\\\\fP
1590.if !\'\\\\$4\'-\' .as mO =\\\\fI\\\\$4\\\\fP
1591.\\}
1592.in 5n
1593\\\\*(mO
1594.in 9n
1595..
1596.de SP
1597.if \\\\n(mH==2 .in 9n
1598.if \\\\n(mH==3 .in 13n
1599.if \\\\n(mH==4 .in 17n
1600..
1601.de FN
1602.nr mH 0
1603.in 5n
1604\\\\$1 \\\\$2
1605.in 9n
1606..
1607.de DS
1608.in +3n
1609.ft 5
1610.nf
1611..
1612.de DE
1613.fi
1614.ft R
1615.in -3n
1616..
1617.SH SYNOPSIS
1618\\fBzwei\\fP\\ [\\ \\fIoptions\\fP\\ ]
1619.SH OPTIONS
1620.OP a aha string yyzzy
1621magic\\esesame
1622.OP x - string bar
1623foo
1624.H2 a[b:c[d[,e]]?f[:g]]
1625A?B:C[]
1626.H2 p\\ \'d\'\\ "q"
1627duh
1628.OP z zoom flag -
1629.SH IMPLEMENTATION
1630.SP'
1631
1632TEST 18 'more compatibility'
1633	usage=$'CD:[macro[=value]]EI:?[dir]MPU:[macro]V?A:[assertion]HTX:[dialect]Y:[stdinclude] [input [output]]'
1634	EXEC	cpp "$usage" -Da=b -Ic -I -Id
1635		OUTPUT - $'return=D option=-D name=-D arg=a=b num=1\nreturn=I option=-I name=-I arg=c num=1\nreturn=I option=-I name=-I arg=(null) num=0\nreturn=I option=-I name=-I arg=d num=1'
1636	EXEC	cpp "$usage" -?
1637		OUTPUT - $'return=? option=-? name=-? num=0'
1638		ERROR - $'Usage: cpp [-CEMPV] [-D macro[=value]] [-I[dir]] [-U macro] [input [output]]'
1639		EXIT 2
1640	usage=$'abc'
1641	EXEC	typeset "$usage" -
1642		OUTPUT - $'argument=1 value="-"'
1643		ERROR -
1644		EXIT 0
1645	EXEC	typeset "+$usage" -
1646	EXEC	typeset "$usage" +
1647		OUTPUT - $'argument=1 value="+"'
1648	EXEC	typeset "+$usage" +
1649	usage=$' file'
1650	EXEC	none "$usage" -?
1651		OUTPUT - $'return=? option=-? name=-? num=0'
1652		ERROR - $'Usage: none [ options ] file'
1653		EXIT 2
1654	EXEC	none "$usage" --api
1655		OUTPUT - $'return=? option=- name=--api num=0'
1656		ERROR - $'.SH SYNOPSIS\nnone [ options ] file'
1657	usage=$'[-]\n\nfile'
1658	EXEC	none "$usage" -?
1659		OUTPUT - $'return=? option=-? name=-? num=0'
1660		ERROR - $'Usage: none [ options ] file'
1661	EXEC	none "$usage" --api
1662		OUTPUT - $'return=? option=- name=--api num=0'
1663		ERROR - $'.SH SYNOPSIS\nnone [ options ] file\n.SH IMPLEMENTATION\n.SP'
1664
1665TEST 19 'mutual exclusion'
1666	usage=$'[-][\t[a:A][b:B][c:C]\t][d:D]\n\n[ file ... ]'
1667	EXEC	mutex "$usage" -?
1668		OUTPUT - $'return=? option=-? name=-? num=0'
1669		ERROR - $'Usage: mutex [-d] [ -a | -b | -c ] [ file ... ]'
1670		EXIT 2
1671	usage=$'[-] [ [a:A][b:B][c:C] ] [d:D]\n\n[ file ... ]'
1672	EXEC	mutex "$usage" -?
1673	usage=$'[abc]d [ file ... ]'
1674	EXEC	mutex "$usage" -?
1675
1676TEST 20 'flag alternation'
1677	usage=$'[-][a|A:aha][b|q|z:foo][n|m=10:meth]:[meth][x:bar]\n\nfile ...'
1678	EXEC	alt "$usage" -a
1679		OUTPUT - $'return=a option=-a name=-a arg=(null) num=1'
1680	EXEC	alt "$usage" -A
1681		OUTPUT - $'return=a option=-A name=-A arg=(null) num=1'
1682	EXEC	alt "$usage" --aha
1683		OUTPUT - $'return=a option=-a name=--aha arg=(null) num=1'
1684	EXEC	alt "$usage" -b
1685		OUTPUT - $'return=b option=-b name=-b arg=(null) num=1'
1686	EXEC	alt "$usage" -q
1687		OUTPUT - $'return=b option=-q name=-q arg=(null) num=1'
1688	EXEC	alt "$usage" -z
1689		OUTPUT - $'return=b option=-z name=-z arg=(null) num=1'
1690	EXEC	alt "$usage" --foo
1691		OUTPUT - $'return=b option=-b name=--foo arg=(null) num=1'
1692	EXEC	alt "$usage" -n nnn
1693		OUTPUT - $'return=-10 option=-10 name=-n arg=nnn num=1'
1694	EXEC	alt "$usage" -m mmm
1695		OUTPUT - $'return=-10 option=-10 name=-m arg=mmm num=1'
1696	EXEC	alt "$usage" --meth=zzz
1697		OUTPUT - $'return=-10 option=-10 name=--meth arg=zzz num=1'
1698	EXEC	alt "$usage" -x
1699		OUTPUT - $'return=x option=-x name=-x arg=(null) num=1'
1700	EXEC	alt "$usage" --bar
1701		OUTPUT - $'return=x option=-x name=--bar arg=(null) num=1'
1702	EXEC	alt "$usage" -?
1703		OUTPUT - $'return=? option=-? name=-? num=0'
1704		ERROR - $'Usage: alt [-aAbqzx] [-n|m meth] file ...'
1705		EXIT 2
1706	EXEC	alt "$usage" --api
1707		OUTPUT - $'return=? option=- name=--api num=0'
1708		ERROR - $'.SH SYNOPSIS
1709alt [ options ] file ...
1710.SH OPTIONS
1711.OP a|A aha flag -
1712.OP b|q|z foo flag -
1713.OP n|m meth string meth
1714.OP x bar flag -
1715.SH IMPLEMENTATION
1716.SP'
1717
1718TEST 21 'justification and emphasis'
1719	usage=$'[-][w!:warn?Warn about invalid \b--check\b lines.][f:format?hours:minutes:seconds.\t\aid\a may be  followed  by [maybe]] \b:case:\b\ap1\a:\as1\a:...:\apn\a:\asn\a which expands to \asi\a if]\n\n[ file ... ]'
1720	EXEC esc "$usage" --???TEST --man
1721		OUTPUT - $'return=? option=-? name=--man num=0'
1722		ERROR - $'\E[1mSYNOPSIS\E[0m
1723  \E[1mesc\E[0m [ \E[1;4moptions\E[0m ] [ file ... ]
1724
1725\E[1mOPTIONS\E[0m
1726  -\E[1mw\E[0m, --\E[1mwarn\E[0m      Warn about invalid \E[1m--check\E[0m lines. On by default; -\E[1mw\E[0m means
1727                  --\E[1mnowarn\E[0m.
1728  -\E[1mf\E[0m, --\E[1mformat\E[0m    hours:minutes:seconds. \E[1;4mid\E[0m may be followed by [maybe]
1729                  \E[1m:case:\E[0m\E[1;4mp1\E[0m:\E[1;4ms1\E[0m:...:\E[1;4mpn\E[0m:\E[1;4msn\E[0m which expands to \E[1;4msi\E[0m if'
1730		EXIT 2
1731	EXEC esc "$usage" --keys
1732		OUTPUT - $'return=? option=- name=--keys num=0'
1733		ERROR - $'"warn"
1734"Warn about invalid \\b--check\\b lines."
1735"format"
1736"hours:minutes:seconds.\\t\\aid\\a may be  followed  by [maybe] \\b:case:\\b\\ap1\\a:\\as1\\a:...:\\apn\\a:\\asn\\a which expands to \\asi\\a if"
1737"[ file ... ]"'
1738
1739TEST 22 'no with values'
1740	usage=$'[-][j:jobs?Job concurrency level.]#[level]'
1741	extra=$'[n!:exec?Execute shell actions.]'
1742	EXEC	make "$usage" -j1 -j 2 --jobs=3 --jobs 4 --nojobs 5 6
1743		OUTPUT - $'return=j option=-j name=-j arg=1 num=1
1744return=j option=-j name=-j arg=2 num=2
1745return=j option=-j name=--jobs arg=3 num=3
1746return=j option=-j name=--jobs arg=4 num=4
1747return=j option=-j name=--jobs arg=(null) num=0
1748argument=1 value="5"
1749argument=2 value="6"'
1750	EXEC	make "$usage$extra" -j1 -j 2 --jobs=3 --jobs 4 --nojobs 5 6
1751	EXEC	make "$usage" --nojobs=1 2
1752		OUTPUT - $'return=: option=-j name=--jobs num=0\nargument=1 value="2"'
1753		ERROR - $'make: --nojobs: value not expected'
1754		EXIT 1
1755	EXEC	make "$usage$extra" --nojobs=1 2
1756
1757TEST 23 'weird help'
1758	usage=$'[-][j:jobs?Job concurrency level.]#[level]'
1759	EXEC	test "$usage" --man=-
1760		OUTPUT - $'return=? option=- name=--man num=0'
1761		ERROR - ''
1762		EXIT 2
1763	EXEC	test "$usage" --man -
1764		ERROR - $'SYNOPSIS
1765  test [ options ]
1766
1767OPTIONS
1768  -j, --jobs=level
1769                  Job concurrency level.'
1770	EXEC	test "$usage" --man --
1771	EXEC	test "$usage" --man
1772	usage=$'[-][!:expand?Compress to 32 byte record format.][!:sort?Sort detail records.]'
1773	EXEC	pzip "$usage" --man
1774		OUTPUT - $'return=? option=- name=--man num=0'
1775		ERROR - 'SYNOPSIS
1776  pzip [ options ]
1777
1778OPTIONS
1779  --expand        Compress to 32 byte record format. On by default; use
1780                  --noexpand to turn off.
1781  --sort          Sort detail records. On by default; use --nosort to turn off.'
1782		EXIT 2
1783
1784TEST 24 'detailed html'
1785	usage=$'[-][-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1989-1999 AT&T Corp.][-license?http://www.research.att.com/sw/license/ast-proprietary.html][+NAME?\bdd\b - copy and convert file][10:if?Input file name (see \aintro\a(2)).]:[file\a (see \bstat\b(2))][11:conv?Conversion option \abegin[-end]]=value\a passed to \bmain\b().]:[conversion][+SEE ALSO?\bcp\b(1), \bpax\b(1), \btr\b(1), \bseek\b(2), \bdd::plugin\b(5P)]'
1786	EXEC	test "$usage" --html
1787		EXIT 2
1788		OUTPUT - $'return=? option=- name=--html num=0'
1789		ERROR - $'<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
1790<HTML>
1791<HEAD>
1792<META name="generator" content="optget (AT&T Research) 2011-11-11">
1793<!--INTERNAL-->
1794<TITLE>dd man document</TITLE>
1795<STYLE type="text/css">
1796div.SH { padding-left:2em; text-indent:0em; }
1797div.SY { padding-left:4em; text-indent:-2em; }
1798dt { float:left; clear:both; }
1799dd { margin-left:3em; }
1800</STYLE>
1801</HEAD>
1802<BODY bgcolor=white>
1803<H4><TABLE width=100%><TR><TH align=left>DD&nbsp;(&nbsp;1&nbsp;)&nbsp;<TH align=center><A href="." title="Index">USER COMMANDS</A><TH align=right>DD&nbsp;(&nbsp;1&nbsp;)</TR></TABLE></H4>
1804<HR>
1805<H4><A name="NAME">NAME</A></H4>
1806<DIV class=SH>
1807<!--MAN-INDEX--><B>dd</B> - copy and convert file
1808<P>
1809</DIV>
1810<H4><A name="SYNOPSIS">SYNOPSIS</A></H4>
1811<DIV class=SY>
1812<B>dd</B> &#0091; <I>options</I> &#0093;
1813<P>
1814</DIV>
1815<H4><A name="OPTIONS">OPTIONS</A></H4>
1816<DIV class=SH>
1817<DL>
1818<DT>--<B>if</B>=<I>file</I> (see
1819<NOBR><A href="../man2/stat.html"><B>stat</B></A>(2))</NOBR><DD><BR>Input file
1820name (see <NOBR><A href="../man2/intro.html"><I>intro</I></A>(2)).</NOBR>
1821<DT>--<B>conv</B>=<I>conversion</I><DD><BR>Conversion option <I>begin&#0091;-end&#0093;=value
1822</I> passed to <B>main</B>().
1823</DL>
1824</DIV>
1825<H4><A name="SEE ALSO">SEE ALSO</A></H4>
1826<DIV class=SH>
1827<NOBR><A href="../man1/cp.html"><B>cp</B></A>(1),</NOBR>
1828<NOBR><A href="../man1/pax.html"><B>pax</B></A>(1),</NOBR>
1829<NOBR><A href="../man1/tr.html"><B>tr</B></A>(1),</NOBR>
1830<NOBR><A href="../man2/seek.html"><B>seek</B></A>(2),</NOBR>
1831<NOBR><A href="../man5P/dd-plugin.html"><B>dd::plugin</B></A>(5P)</NOBR>
1832</DIV>
1833<H4><A name="IMPLEMENTATION">IMPLEMENTATION</A></H4>
1834<DIV class=SH>
1835
1836<DL>
1837<DT><A name="author"><B>author</B></A><DD><BR>Glenn Fowler &lt;<A
1838href="mailto:gsf@research.att.com">gsf@research.att.com</A>&gt;
1839<DT><A name="copyright"><B>copyright</B></A><DD><BR>Copyright &copy; 1989-1999 AT&amp;T Corp.
1840<DT><A name="license"><B>license</B></A><DD><BR><A href="http://www.research.att.com/sw/license/ast-proprietary.html">http://www.research.att.com/sw/license/ast-proprietary.html</A>
1841</DL>
1842</DIV>
1843</BODY>
1844</HTML>'
1845
1846TEST 25 'extra args after help options'
1847	usage=$'[-][a:aha][b:foo][n=10:meth]:[meth][x:bar]\n\nfile ...'
1848	EXEC	extra "$usage" xxx
1849		OUTPUT - $'argument=1 value="xxx"'
1850	EXEC	extra "$usage" --short
1851		OUTPUT - $'return=? option=- name=--short num=0'
1852		ERROR - $'Usage: extra [-abx] [-n meth] file ...'
1853		EXIT 2
1854	EXEC	extra "$usage" --short xxx
1855	EXEC	extra "$usage" --??short
1856		OUTPUT - $'return=? option=-? name=--??short num=0'
1857	EXEC	extra "$usage" --??short xxx
1858
1859TEST 26 'usage combinations'
1860	lib1=$'[-1l?library][--catalog?nyuk][-author?Dewey Cheatham][+LIBRARY?\b-loser\b - user library][b:bbb?BBB][+EXIT STATUS?]{[+0?Spread out.][+>0?Why you.]}[+SEE ALSO?\bfoo\b(1)]'
1861	lib2=$'[-1i?implicit][-author?Andy Howe][+LIBRARY?implicit library][z:zzz?ZZZ]'
1862	usage=$'[-?main][-author?Bea Taylor][+NAME?\baha\b - bwoohahahahah][a:aha?AHA] [ file ... ]'
1863	EXEC	+ "$lib1" + "$lib2" combo "$usage" --aha
1864		OUTPUT - $'return=a option=-a name=--aha arg=(null) num=1'
1865	EXEC	+ "$lib1" + "$lib2" combo "$usage" --bbb
1866		EXIT 1
1867		OUTPUT - $'return=: option= name=--bbb num=0 str=--bbb'
1868		ERROR - $'combo: --bbb: unknown option'
1869	EXEC	+ "$lib1" + "$lib2" combo "$usage" --aha --man
1870		EXIT 2
1871		OUTPUT - $'return=a option=-a name=--aha arg=(null) num=1\nreturn=? option=-a name=--man num=1'
1872		ERROR - $'NAME
1873  aha - bwoohahahahah
1874
1875SYNOPSIS
1876  aha [ options ]
1877
1878OPTIONS
1879  -a, --aha       AHA
1880
1881IMPLEMENTATION
1882  version         main
1883  author          Bea Taylor
1884
1885LIBRARY
1886  -loser - user library
1887
1888OPTIONS
1889  --bbb           BBB
1890
1891EXIT STATUS
1892    0     Spread out.
1893    >0    Why you.
1894
1895SEE ALSO
1896  foo(1)
1897
1898IMPLEMENTATION
1899  version         library
1900  author          Dewey Cheatham'
1901	EXEC	combo "$lib1" --bbb --?bbb
1902		OUTPUT - $'return=b option=-b name=--bbb arg=(null) num=1\nreturn=? option=-? name=--?bbb num=1'
1903		ERROR - $'Usage: combo [ options ]\nOPTIONS\n  --bbb           BBB'
1904	EXEC	+ "$lib1" + "$lib2" combo "$usage" --aha --?bbb
1905		OUTPUT - $'return=a option=-a name=--aha arg=(null) num=1\nreturn=? option=-? name=--?bbb num=1'
1906	EXEC	+ "$lib1" + "$lib2" combo "$usage" --aha --usage
1907		OUTPUT - $'return=a option=-a name=--aha arg=(null) num=1\nreturn=? option=-a name=--usage num=1'
1908		ERROR - $'[-1l?library][--catalog?nyuk][-author?Dewey Cheatham][+LIBRARY?\\b-loser\\b - user library][b:bbb?BBB][+EXIT STATUS?]{[+0?Spread out.][+>0?Why you.]}[+SEE ALSO?\\bfoo\\b(1)]'
1909	EXEC	+ "$lib1" + "$lib2" combo "$usage" --aha --keys
1910		OUTPUT - $'return=a option=-a name=--aha arg=(null) num=1\nreturn=? option=-a name=--keys num=1'
1911		ERROR - $'"\\b-loser\\b - user library"
1912"bbb"
1913"BBB"
1914"Spread out."
1915"Why you."
1916"\\bfoo\\b(1)"'
1917	usage=$'[-?main][-author?Opie][+NAME?\baha\b - bwoohahahahah][ [b:bar?BAR][f:foo?FOO] ]\n\n[ file ... ]\n\n[+EXIT STATUS?]{[+0?okeedokee][+!=0?eekodeeko]}[+SEE ALSO?\bslingshot\b(1)]'
1918	EXEC	rfd "$usage" --keys
1919		OUTPUT - $'return=? option=- name=--keys num=0'
1920		ERROR - $'"\\baha\\b - bwoohahahahah"
1921"bar"
1922"BAR"
1923"foo"
1924"FOO"
1925"[ file ... ]"
1926"okeedokee"
1927"eekodeeko"
1928"\\bslingshot\\b(1)"'
1929	usage=$'[-] \t\n[+NAME?bar][f:flag]'
1930	EXEC	foo "$usage" --short
1931		OUTPUT - $'return=? option=- name=--short num=0'
1932		ERROR - $'Usage: foo [-f]'
1933	EXEC	foo "$usage" --long
1934		OUTPUT - $'return=? option=- name=--long num=0'
1935		ERROR - $'Usage: foo [--flag]'
1936	EXEC	foo "$usage" --usage
1937		OUTPUT - $'return=? option=- name=--usage num=0'
1938		ERROR - $'[-] \\t\\n[+NAME?bar][f:flag]'
1939	EXEC	foo "$usage" --man
1940		OUTPUT - $'return=? option=- name=--man num=0'
1941		ERROR - $'NAME
1942  bar
1943
1944SYNOPSIS
1945  bar [ options ]
1946
1947OPTIONS
1948  -f, --flag'
1949	EXEC	foo "$usage" --html
1950		OUTPUT - $'return=? option=- name=--html num=0'
1951		ERROR - $'<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
1952<HTML>
1953<HEAD>
1954<META name="generator" content="optget (AT&T Research) 2011-11-11">
1955<TITLE>bar man document</TITLE>
1956<STYLE type="text/css">
1957div.SH { padding-left:2em; text-indent:0em; }
1958div.SY { padding-left:4em; text-indent:-2em; }
1959dt { float:left; clear:both; }
1960dd { margin-left:3em; }
1961</STYLE>
1962</HEAD>
1963<BODY bgcolor=white>
1964<H4><TABLE width=100%><TR><TH align=left>BAR&nbsp;(&nbsp;1&nbsp;)&nbsp;<TH align=center><A href="." title="Index">USER COMMANDS</A><TH align=right>BAR&nbsp;(&nbsp;1&nbsp;)</TR></TABLE></H4>
1965<HR>
1966<H4><A name="NAME">NAME</A></H4>
1967<DIV class=SH>
1968<!--MAN-INDEX-->bar
1969<P>
1970</DIV>
1971<H4><A name="SYNOPSIS">SYNOPSIS</A></H4>
1972<DIV class=SY>
1973<B>bar</B> &#0091; <I>options</I> &#0093;
1974<P>
1975</DIV>
1976<H4><A name="OPTIONS">OPTIONS</A></H4>
1977<DIV class=SH>
1978-<B>f</B>, --<B>flag</B>
1979</DIV>
1980</BODY>
1981</HTML>'
1982
1983TEST 27 'opt_info.num with opt_info.arg'
1984	usage=$'[-][f:flag][m:must]:[yes][o:optional]:?[maybe]'
1985	EXEC	huh "$usage" --noflag
1986		OUTPUT - $'return=f option=-f name=--flag arg=(null) num=0'
1987	EXEC	huh "$usage" --flag
1988		OUTPUT - $'return=f option=-f name=--flag arg=(null) num=1'
1989	EXEC	huh "$usage" -f
1990		OUTPUT - $'return=f option=-f name=-f arg=(null) num=1'
1991	EXEC	huh "$usage" --nomust
1992		OUTPUT - $'return=m option=-m name=--must arg=(null) num=0'
1993	EXEC	huh "$usage" --must=ok
1994		OUTPUT - $'return=m option=-m name=--must arg=ok num=1'
1995	EXEC	huh "$usage" --must ok
1996	EXEC	huh "$usage" -mok
1997		OUTPUT - $'return=m option=-m name=-m arg=ok num=1'
1998	EXEC	huh "$usage" -m ok
1999		OUTPUT - $'return=m option=-m name=-m arg=ok num=1'
2000	EXEC	huh "$usage" --nooptional
2001		OUTPUT - $'return=o option=-o name=--optional arg=(null) num=0'
2002	EXEC	huh "$usage" --optional
2003		OUTPUT - $'return=o option=-o name=--optional arg=(null) num=1'
2004	EXEC	huh "$usage" --optional -f
2005		OUTPUT - $'return=o option=-o name=--optional arg=(null) num=1\nreturn=f option=-f name=-f arg=(null) num=1'
2006	EXEC	huh "$usage" -o
2007		OUTPUT - $'return=o option=-o name=-o arg=(null) num=1'
2008	EXEC	huh "$usage" -o -f
2009		OUTPUT - $'return=o option=-o name=-o arg=(null) num=0\nreturn=f option=-f name=-f arg=(null) num=1'
2010	EXEC	huh "$usage" --optional=ok
2011		OUTPUT - $'return=o option=-o name=--optional arg=ok num=1'
2012	EXEC	huh "$usage" --optional ok
2013		OUTPUT - $'return=o option=-o name=--optional arg=(null) num=1\nargument=1 value="ok"'
2014	EXEC	huh "$usage" -ook
2015		OUTPUT - $'return=o option=-o name=-o arg=ok num=1'
2016	EXEC	huh "$usage" -o ok
2017		OUTPUT - $'return=o option=-o name=-o arg=ok num=1'
2018	EXEC	huh "$usage" --must
2019		OUTPUT - $'return=: option=-m name=--must num=0'
2020		ERROR - $'huh: --must: yes value expected'
2021		EXIT 1
2022
2023TEST 28 'user defined optget return value'
2024	usage=$'[-n][n:count]#[number][234:ZZZ]'
2025	EXEC	num "$usage" -123
2026		OUTPUT - $'return=n option=-n name=-1 arg=123 num=123'
2027	EXEC	num "$usage" -234
2028		OUTPUT - $'return=n option=-n name=-2 arg=234 num=234'
2029
2030TEST 29 'usage stack'
2031	usage=$'[-?main][-author?Barney Fife][+NAME?\baha\b - bwoohahahahah][a:aha?AHA.]\foptions\f[q:what?Explain in detail.] [ file ... ]'
2032	EXEC	info "$usage" --aha --zoom --boom=junk --what
2033		OUTPUT - $'return=a option=-a name=--aha arg=(null) num=1
2034return=Z option=-Z name=--zoom arg=(null) num=1
2035return=B option=-B name=--boom arg=junk num=1
2036return=q option=-q name=--what arg=(null) num=1'
2037	EXEC	info "$usage" --man
2038		EXIT 2
2039		OUTPUT - $'return=? option=- name=--man num=0'
2040		ERROR - $'NAME
2041  aha - bwoohahahahah
2042
2043SYNOPSIS
2044  aha [ options ]
2045
2046OPTIONS
2047  -a, --aha       AHA.
2048  -Z, --zoom      Do it as fast as possible.
2049  -C, --cram      Cram as much as possible.
2050  -K, --kill      kill all processes.
2051  -F, --fudge     Fudge the statistics to satisfy everyone.
2052  -D, --dump      Dump as much as possible.
2053  -B, --boom=file Dump into file.
2054  -q, --what      Explain in detail.
2055
2056IMPLEMENTATION
2057  version         main
2058  author          Barney Fife'
2059
2060TEST 30 'library interfaces'
2061	USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1995-1999 AT&T Corp.][-license?http://www.research.att.com/sw/license/ast-open.html]"
2062	usage=$'
2063[-1s3S?@(#)sum (AT&T Research) 1999-12-11]'$USAGE_LICENSE$'
2064[+NAME?sum - checksum library]
2065[+DESCRIPTION?\bsum\b is a checksum library.]
2066[Sum_t*:sumopen(const char* \amethod\a)?Open a sum handle for \amethod\a.]
2067[int:sumclose(Sum_t* \asum\a)?Close a sum handle \asum\a previously returned
2068	by \bsumopen\b.]
2069
2070#include <sum.h>
2071
2072[+SEE ALSO?\bcksum\b(1)]
2073'
2074	EXEC	sum "$usage" --html
2075		EXIT 2
2076		OUTPUT - $'return=? option=- name=html num=0'
2077		ERROR - $'<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2078<HTML>
2079<HEAD>
2080<META name="generator" content="optget (AT&T Research) 2011-11-11">
2081<TITLE>sum man document</TITLE>
2082<STYLE type="text/css">
2083div.SH { padding-left:2em; text-indent:0em; }
2084div.SY { padding-left:4em; text-indent:-2em; }
2085dt { float:left; clear:both; }
2086dd { margin-left:3em; }
2087</STYLE>
2088</HEAD>
2089<BODY bgcolor=white>
2090<H4><TABLE width=100%><TR><TH align=left>SUM&nbsp;(&nbsp;3S&nbsp;)&nbsp;<TH align=center><A href="." title="Index">STANDARD I/O FUNCTIONS</A><TH align=right>SUM&nbsp;(&nbsp;3S&nbsp;)</TR></TABLE></H4>
2091<HR>
2092<H4><A name="NAME">NAME</A></H4>
2093<DIV class=SH>
2094<!--MAN-INDEX-->sum - checksum library
2095<P>
2096</DIV>
2097<H4><A name="SYNOPSIS">SYNOPSIS</A></H4>
2098<DIV class=SY>
2099#include &lt;sum.h&gt;
2100</DIV>
2101<H4><A name="DESCRIPTION">DESCRIPTION</A></H4>
2102<DIV class=SH>
2103<B>sum</B> is a checksum library.
2104<P>
2105</DIV>
2106<H4><A name="FUNCTIONS">FUNCTIONS</A></H4>
2107<DIV class=SH>
2108<DL>
2109<DT>Sum_t* <B>sumopen</B>(const char* <I>method</I>)<DD><BR>Open a sum handle for
2110<I>method</I>.
2111<DT>int <B>sumclose</B>(Sum_t* <I>sum</I>)<DD><BR>Close a sum handle <I>sum</I>
2112previously returned by <B>sumopen</B>.
2113</DL>
2114</DIV>
2115<H4><A name="SEE ALSO">SEE ALSO</A></H4>
2116<DIV class=SH>
2117<NOBR><A href="../man1/cksum.html"><B>cksum</B></A>(1)</NOBR>
2118</DIV>
2119<H4><A name="IMPLEMENTATION">IMPLEMENTATION</A></H4>
2120<DIV class=SH>
2121<DL>
2122<DT><A name="version"><B>version</B></A><DD><BR>sum (AT&amp;T Research) 1999-12-11
2123<DT><A name="author"><B>author</B></A><DD><BR>Glenn Fowler &lt;<A
2124href="mailto:gsf@research.att.com">gsf@research.att.com</A>&gt;
2125<DT><A name="copyright"><B>copyright</B></A><DD><BR>Copyright &copy; 1995-1999 AT&amp;T Corp.
2126<DT><A name="license"><B>license</B></A><DD><BR><A href="http://www.research.att.com/sw/license/ast-open.html">http://www.research.att.com/sw/license/ast-open.html</A>
2127</DL>
2128</DIV>
2129</BODY>
2130</HTML>'
2131	EXEC	sum "$usage" --nroff
2132		OUTPUT - $'return=? option=- name=nroff num=0'
2133		ERROR - $'.\\" format with nroff|troff|groff -man
2134.TH SUM 3S 1999-12-11
2135.fp 5 CW
2136.nr mH 5
2137.de H0
2138.nr mH 0
2139.in 5n
2140\\fB\\\\$1\\fP
2141.in 7n
2142..
2143.de H1
2144.nr mH 1
2145.in 7n
2146\\fB\\\\$1\\fP
2147.in 9n
2148..
2149.de H2
2150.nr mH 2
2151.in 11n
2152\\fB\\\\$1\\fP
2153.in 13n
2154..
2155.de H3
2156.nr mH 3
2157.in 15n
2158\\fB\\\\$1\\fP
2159.in 17n
2160..
2161.de H4
2162.nr mH 4
2163.in 19n
2164\\fB\\\\$1\\fP
2165.in 21n
2166..
2167.de OP
2168.nr mH 0
2169.ie !\'\\\\$1\'-\' \\{
2170.ds mO \\\\fB\\\\-\\\\$1\\\\fP
2171.ds mS ,\\\\0
2172.\\}
2173.el \\{
2174.ds mO \\\\&
2175.ds mS \\\\&
2176.\\}
2177.ie \'\\\\$2\'-\' \\{
2178.if !\'\\\\$4\'-\' .as mO \\\\0\\\\fI\\\\$4\\\\fP
2179.\\}
2180.el \\{
2181.as mO \\\\*(mS\\\\fB\\\\$2\\\\fP
2182.if !\'\\\\$4\'-\' .as mO =\\\\fI\\\\$4\\\\fP
2183.\\}
2184.in 5n
2185\\\\*(mO
2186.in 9n
2187..
2188.de SP
2189.if \\\\n(mH==2 .in 9n
2190.if \\\\n(mH==3 .in 13n
2191.if \\\\n(mH==4 .in 17n
2192..
2193.de FN
2194.nr mH 0
2195.in 5n
2196\\\\$1 \\\\$2
2197.in 9n
2198..
2199.de DS
2200.in +3n
2201.ft 5
2202.nf
2203..
2204.de DE
2205.fi
2206.ft R
2207.in -3n
2208..
2209.SH NAME
2210sum \\- checksum library
2211.SH SYNOPSIS
2212#include\\ <sum\\&.h>
2213.SH DESCRIPTION
2214\\fBsum\\fP is a checksum library\\&.
2215.SH FUNCTIONS
2216.FN Sum_t*\\ \\fBsumopen\\fP(const\\ char*\\ \\fImethod\\fP)
2217Open a sum handle for \\fImethod\\fP\\&.
2218.FN int\\ \\fBsumclose\\fP(Sum_t*\\ \\fIsum\\fP)
2219Close a sum handle \\fIsum\\fP previously returned by \\fBsumopen\\fP\\&.
2220.SH SEE\\ ALSO
2221\\fBcksum\\fP(1)
2222.SH IMPLEMENTATION
2223.H0 version
2224sum (AT&T Research) 1999\\-12\\-11
2225.H0 author
2226Glenn Fowler <gsf@research\\&.att\\&.com>
2227.H0 copyright
2228Copyright (c) 1995\\-1999 AT&T Corp\\&.
2229.H0 license
2230http://www\\&.research\\&.att\\&.com/sw/license/ast\\-open\\&.html'
2231
2232TEST 31 'off by one -- my epitaph'
2233	short_usage=$'[-n][n]#[s]:\n\npid ...'
2234	long_usage=$'[-n][n:number]#[s:name]:\n\npid ...'
2235	EXEC	kill "$short_usage" -0 123
2236		OUTPUT - $'return=n option=-n name=-0 arg=0 num=0\nargument=1 value="123"'
2237	EXEC	kill "$long_usage" -0 123
2238	EXEC	kill "$short_usage" -T 123
2239		OUTPUT - $'return=: option= name=-T num=0 str=[-n][n]#[s]:\n\npid ...\nargument=1 value="123"'
2240		ERROR - $'kill: -T: unknown option'
2241		EXIT 1
2242	EXEC	kill "$long_usage" -T 123
2243		OUTPUT - $'return=: option= name=-T num=0 str=[-n][n:number]#[s:name]:\n\npid ...\nargument=1 value="123"'
2244
2245TEST 32 'miscellaneous'
2246	usage=$'[-][+NAME?wow - zowee][a|b:aORb?A or B.][y|z:yORz?Y or Z.]\n\n[ file ... ]'
2247	EXEC	wow "$usage" --nroff
2248		EXIT 2
2249		OUTPUT - $'return=? option=- name=--nroff num=0'
2250		ERROR - $'.\\" format with nroff|troff|groff -man
2251.TH WOW 1
2252.fp 5 CW
2253.nr mH 5
2254.de H0
2255.nr mH 0
2256.in 5n
2257\\fB\\\\$1\\fP
2258.in 7n
2259..
2260.de H1
2261.nr mH 1
2262.in 7n
2263\\fB\\\\$1\\fP
2264.in 9n
2265..
2266.de H2
2267.nr mH 2
2268.in 11n
2269\\fB\\\\$1\\fP
2270.in 13n
2271..
2272.de H3
2273.nr mH 3
2274.in 15n
2275\\fB\\\\$1\\fP
2276.in 17n
2277..
2278.de H4
2279.nr mH 4
2280.in 19n
2281\\fB\\\\$1\\fP
2282.in 21n
2283..
2284.de OP
2285.nr mH 0
2286.ie !\'\\\\$1\'-\' \\{
2287.ds mO \\\\fB\\\\-\\\\$1\\\\fP
2288.ds mS ,\\\\0
2289.\\}
2290.el \\{
2291.ds mO \\\\&
2292.ds mS \\\\&
2293.\\}
2294.ie \'\\\\$2\'-\' \\{
2295.if !\'\\\\$4\'-\' .as mO \\\\0\\\\fI\\\\$4\\\\fP
2296.\\}
2297.el \\{
2298.as mO \\\\*(mS\\\\fB\\\\-\\\\-\\\\$2\\\\fP
2299.if !\'\\\\$4\'-\' .as mO =\\\\fI\\\\$4\\\\fP
2300.\\}
2301.in 5n
2302\\\\*(mO
2303.in 9n
2304..
2305.de SP
2306.if \\\\n(mH==2 .in 9n
2307.if \\\\n(mH==3 .in 13n
2308.if \\\\n(mH==4 .in 17n
2309..
2310.de FN
2311.nr mH 0
2312.in 5n
2313\\\\$1 \\\\$2
2314.in 9n
2315..
2316.de DS
2317.in +3n
2318.ft 5
2319.nf
2320..
2321.de DE
2322.fi
2323.ft R
2324.in -3n
2325..
2326.SH NAME
2327wow \\- zowee
2328.SH SYNOPSIS
2329\\fBwow\\fP\\ [\\ \\fIoptions\\fP\\ ]\\ [\\ file\\ \\&.\\&.\\&.\\ ]
2330.SH OPTIONS
2331.OP a|b aORb flag -
2332A or B\\&.
2333.OP y|z yORz flag -
2334Y or Z\\&.
2335.SH IMPLEMENTATION
2336.SP'
2337
2338TEST 33 'never thought of that'
2339	usage=$'n: path'
2340	EXEC	printf "$usage" +1
2341		EXIT 0
2342		OUTPUT - $'argument=1 value="+1"'
2343		ERROR -
2344	usage=$'[-][+NAME?printf][n:num?number]:[val]\n\npath'
2345	EXEC	printf "$usage" +1
2346	usage=$'[-][+NAME?printf][n:num?number]:[#]\n\npath'
2347	EXEC	printf "$usage" +1
2348	usage=$'n# path'
2349	EXEC	printf "$usage" +1
2350	usage=$'n#[val] path'
2351	EXEC	printf "$usage" +1
2352	usage=$'[-][+NAME?printf][n:num?number]#[#]\n\npath'
2353	EXEC	printf "$usage" +1
2354	usage=$'[-n][+NAME?printf][n:num?number]#[#]\n\npath'
2355	EXEC	printf "$usage" +1
2356		OUTPUT - $'return=n option=+n name=+1 arg=1 num=1'
2357	EXEC	printf "$usage" -1
2358		OUTPUT - $'return=n option=-n name=-1 arg=1 num=1'
2359	EXEC	printf "$usage" +1 -1
2360		OUTPUT - $'return=n option=+n name=+1 arg=1 num=1\nreturn=n option=-n name=-1 arg=1 num=1'
2361	usage=$'[-][x:xxx]#[yyy?could be:]{[+seeing?double]}'
2362	EXEC	kill "$usage" --man
2363		EXIT 2
2364		OUTPUT - $'return=? option=- name=--man num=0'
2365		ERROR - $'SYNOPSIS
2366  kill [ options ]
2367
2368OPTIONS
2369  -x, --xxx=yyy   could be:
2370                    seeing
2371                          double'
2372	usage=$'[-][+NAME?find][71:printf]:[format]{[+foo? ][+a?alert]}'
2373	EXEC find "$usage" --man
2374		ERROR - $'NAME
2375  find
2376
2377SYNOPSIS
2378  find [ options ]
2379
2380OPTIONS
2381  --printf=format
2382                    foo
2383                    a     alert'
2384	usage=$'[-][+NAME?find][71:printf]:[format]{[+foo?][+a?alert]}'
2385	EXEC find "$usage" --man
2386	usage=$'[-][+NAME?find][71:printf]:[format]{[+foo?][+a?alert]}'
2387	EXEC find "$usage" --man
2388
2389TEST 35 'alternate version ids'
2390	EXEC id $'[-?\n@(#)id (spamco) 2000-12-01\n]' --?-version
2391		OUTPUT - $'return=? option=-? name=--?-version num=0'
2392		ERROR - $'  version         id (spamco) 2000-12-01'
2393		EXIT 2
2394	EXEC id $'[-?\n@(#)  \t  id (spamco) 2000-12-01\n]' --?-version
2395	EXEC id $'[-?\n$Id: id (spamco) 2000-12-01 $\n]' --?-version
2396		ERROR - $'  version         id (spamco) 2000-12-01'
2397	EXEC id $'[-?\n@(#)$Id: id (spamco) 2000-12-01 $\n]' --?-version
2398	EXEC id $'[-?\n$Id: @(#)id (spamco) 2000-12-01 $\n]' --?-version
2399
2400TEST 36 'enumerated option argument values'
2401	usage=$'[-?\naha\n][Q:quote?Quote names according to \astyle\a:]:[style:=question]{\n[c:C?C style.][A:always?Always shell style.][101:shell?Shell quote if necessary.][q:question?Replace unknown chars with ?.]\n}'
2402	EXEC ls "$usage" --man
2403		EXIT 2
2404		OUTPUT - 'return=? option=- name=--man num=0'
2405		ERROR - 'SYNOPSIS
2406  ls [ options ]
2407
2408OPTIONS
2409  -Q, --quote=style
2410                  Quote names according to style:
2411                    c|C   C style.
2412                    A|always
2413                          Always shell style.
2414                    shell Shell quote if necessary.
2415                    question
2416                          Replace unknown chars with ?.
2417                  The default value is question.
2418
2419IMPLEMENTATION
2420  version         aha'
2421	EXEC ls "$usage" --quote
2422		EXIT 1
2423		OUTPUT - 'return=: option=-Q name=--quote num=0'
2424		ERROR - 'ls: --quote: style value expected'
2425	EXEC ls "$usage" --quote=alx
2426		ERROR - 'ls: --quote: alx: unknown option argument value'
2427	EXEC ls "$usage" --quote=c
2428		EXIT 0
2429		OUTPUT - 'return=Q option=-Q name=--quote arg=c num=99'
2430		ERROR -
2431	EXEC ls "$usage" --quote=C
2432		OUTPUT - 'return=Q option=-Q name=--quote arg=C num=99'
2433	EXEC ls "$usage" -Q shell
2434		OUTPUT - 'return=Q option=-Q name=-Q arg=shell num=-101'
2435	EXEC ls "$usage" -Qs
2436		OUTPUT - 'return=Q option=-Q name=-Q arg=s num=-101'
2437
2438TEST 37 'stealth bugs'
2439	usage=$'[-?\naha\n][-catalog?SpamCo][h:html?Read html from \afile\a.]:[file[??name=value;...]]]'
2440	EXEC m2h "$usage" -h
2441		EXIT 1
2442		OUTPUT - 'return=: option=-h name=-h num=0'
2443		ERROR - 'm2h: -h: file[?name=value;...] argument expected'
2444	EXEC m2h "$usage" --man
2445		EXIT 2
2446		OUTPUT - 'return=? option=- name=--man num=0'
2447		ERROR - 'SYNOPSIS
2448  m2h [ options ]
2449
2450OPTIONS
2451  -h, --html=file[?name=value;...]
2452                  Read html from file.
2453
2454IMPLEMENTATION
2455  version         aha
2456  catalog         SpamCo'
2457	EXEC m2h "$usage" --keys
2458		OUTPUT - 'return=? option=- name=--keys num=0'
2459		ERROR - '"catalog"
2460"html"
2461"Read html from \afile\a."
2462"file[?name=value;...]"'
2463	EXEC ls $'[-][w:width]#[screen-width]' -wx
2464		OUTPUT - $'return=: option=-w name=-w num=0'
2465		ERROR - $'ls: -w: numeric screen-width argument expected'
2466		EXIT 1
2467
2468TEST 38 'ancient compatibility for modern implementations -- ok, I still use vi'
2469	usage=$'[-1o][a:all][f:full][l:long][u:user]:[uid]\n\n[ pid ... ]\n\n'
2470	EXEC ps "$usage" --man
2471		EXIT 2
2472		OUTPUT - 'return=? option=- name=--man num=0'
2473		ERROR - 'SYNOPSIS
2474  ps [ options ] [ pid ... ]
2475
2476OPTIONS
2477  -a, --all
2478  -f, --full
2479  -l, --long
2480  -u, --user=uid'
2481	EXEC ps "$usage" a 123
2482		EXIT 0
2483		OUTPUT - 'return=a option=-a name=-a arg=(null) num=1
2484argument=1 value="123"'
2485		ERROR -
2486	EXEC ps "$usage" -a 123
2487	EXEC ps "$usage" al 123
2488		OUTPUT - 'return=a option=-a name=-a arg=(null) num=1
2489return=l option=-l name=-l arg=(null) num=1
2490argument=1 value="123"'
2491	EXEC ps "$usage" -al 123
2492	EXEC ps "$usage" a l 123
2493	EXEC ps "$usage" a -l 123
2494	EXEC ps "$usage" u bozo l 123
2495		OUTPUT - 'return=u option=-u name=-u arg=bozo num=1
2496return=l option=-l name=-l arg=(null) num=1
2497argument=1 value="123"'
2498	EXEC ps "$usage" -u bozo -l 123
2499	EXEC ps "$usage" a u bozo l 123
2500		OUTPUT - 'return=a option=-a name=-a arg=(null) num=1
2501return=u option=-u name=-u arg=bozo num=1
2502return=l option=-l name=-l arg=(null) num=1
2503argument=1 value="123"'
2504
2505TEST 39 'local suboptions'
2506	usage=$'[-?\naha\n][+NAME?search][x:method?The algorithm:]:[method:=linear]{[linear?Fast.][quadratic?Slower. Sub-options:]{[-][e:edges?Limit edges.]#[n:=50]}[np?Slow.][heuristic?Almost works. Sub-options:]{[-][n:nodes?Limit nodes.]#?[n:=100][f:foo?Bar.]:[huh][d:dump?Dump tables.][l:label?Set label.]:[string]}}[D:debug?Debug level.]#[level][+SEE ALSO?\afoo\a(1)]'
2507	EXEC search "$usage" --man
2508		EXIT 2
2509		OUTPUT - 'return=? option=- name=--man num=0'
2510		ERROR - 'NAME
2511  search
2512
2513SYNOPSIS
2514  search [ options ]
2515
2516OPTIONS
2517  -x, --method=method
2518                  The algorithm:
2519                    linear
2520                          Fast.
2521                    quadratic
2522                          Slower. Sub-options:
2523                            edges=n
2524                                  Limit edges. The default value is 50.
2525                    np    Slow.
2526                    heuristic
2527                          Almost works. Sub-options:
2528                            nodes[=n]
2529                                  Limit nodes. The option value may be omitted.
2530                                  The default value is 100.
2531                            foo=huh
2532                                  Bar.
2533                            dump  Dump tables.
2534                            label=string
2535                                  Set label.
2536                  The default value is linear.
2537  -D, --debug=level
2538                  Debug level.
2539
2540SEE ALSO
2541  foo(1)
2542
2543IMPLEMENTATION
2544  version         aha'
2545
2546TEST 40 'examples of example examples'
2547	usage=$'[-?\naha\n][-catalog?SpamCo][+NAME?eg - test example examples][Q:quote?Quote names according to \astyle\a:]:[style:=question][+EXAMPLES]{[+\none\ntwo][+\n\vthree\nfour][+\n\afive\nsix]}[+SEE ALSO?\begman\b(1)]'
2548	EXEC eg "$usage" --man
2549		EXIT 2
2550		OUTPUT - 'return=? option=- name=--man num=0'
2551		ERROR - $'NAME
2552  eg - test example examples
2553
2554SYNOPSIS
2555  eg [ options ]
2556
2557OPTIONS
2558  -Q, --quote=style
2559                  Quote names according to style: The default value is
2560                  question.
2561
2562EXAMPLES
2563    one
2564    two
2565
2566    three
2567    four
2568
2569    five
2570    six
2571
2572SEE ALSO
2573  egman(1)
2574
2575IMPLEMENTATION
2576  version         aha
2577  catalog         SpamCo'
2578	EXEC eg "$usage" --nroff
2579		OUTPUT - 'return=? option=- name=--nroff num=0'
2580		ERROR - $'.\\" format with nroff|troff|groff -man
2581.TH EG 1
2582.fp 5 CW
2583.nr mH 5
2584.de H0
2585.nr mH 0
2586.in 5n
2587\\fB\\\\$1\\fP
2588.in 7n
2589..
2590.de H1
2591.nr mH 1
2592.in 7n
2593\\fB\\\\$1\\fP
2594.in 9n
2595..
2596.de H2
2597.nr mH 2
2598.in 11n
2599\\fB\\\\$1\\fP
2600.in 13n
2601..
2602.de H3
2603.nr mH 3
2604.in 15n
2605\\fB\\\\$1\\fP
2606.in 17n
2607..
2608.de H4
2609.nr mH 4
2610.in 19n
2611\\fB\\\\$1\\fP
2612.in 21n
2613..
2614.de OP
2615.nr mH 0
2616.ie !\'\\\\$1\'-\' \\{
2617.ds mO \\\\fB\\\\-\\\\$1\\\\fP
2618.ds mS ,\\\\0
2619.\\}
2620.el \\{
2621.ds mO \\\\&
2622.ds mS \\\\&
2623.\\}
2624.ie \'\\\\$2\'-\' \\{
2625.if !\'\\\\$4\'-\' .as mO \\\\0\\\\fI\\\\$4\\\\fP
2626.\\}
2627.el \\{
2628.as mO \\\\*(mS\\\\fB\\\\-\\\\-\\\\$2\\\\fP
2629.if !\'\\\\$4\'-\' .as mO =\\\\fI\\\\$4\\\\fP
2630.\\}
2631.in 5n
2632\\\\*(mO
2633.in 9n
2634..
2635.de SP
2636.if \\\\n(mH==2 .in 9n
2637.if \\\\n(mH==3 .in 13n
2638.if \\\\n(mH==4 .in 17n
2639..
2640.de FN
2641.nr mH 0
2642.in 5n
2643\\\\$1 \\\\$2
2644.in 9n
2645..
2646.de DS
2647.in +3n
2648.ft 5
2649.nf
2650..
2651.de DE
2652.fi
2653.ft R
2654.in -3n
2655..
2656.SH NAME
2657eg \\- test example examples
2658.SH SYNOPSIS
2659\\fBeg\\fP\\ [\\ \\fIoptions\\fP\\ ]
2660.SH OPTIONS
2661.OP Q quote string style question
2662Quote names according to \\fIstyle\\fP:
2663The default value is \\fBquestion\\fP\\&.
2664.SH EXAMPLES
2665.DS
2666\\f5one
2667two\\fP
2668.DE
2669.DS
2670three
2671four
2672.DE
2673.DS
2674\\fIfive
2675six\\fP
2676.DE
2677.SH SEE\\ ALSO
2678\\fBegman\\fP(1)
2679.SH IMPLEMENTATION
2680.H0 version
2681aha
2682.H0 catalog
2683SpamCo'
2684
2685	EXEC eg "$usage" --html
2686		OUTPUT - 'return=? option=- name=--html num=0'
2687		ERROR - $'<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2688<HTML>
2689<HEAD>
2690<META name="generator" content="optget (AT&T Research) 2011-11-11">
2691<TITLE>eg man document</TITLE>
2692<STYLE type="text/css">
2693div.SH { padding-left:2em; text-indent:0em; }
2694div.SY { padding-left:4em; text-indent:-2em; }
2695dt { float:left; clear:both; }
2696dd { margin-left:3em; }
2697</STYLE>
2698</HEAD>
2699<BODY bgcolor=white>
2700<H4><TABLE width=100%><TR><TH align=left>EG&nbsp;(&nbsp;1&nbsp;)&nbsp;<TH align=center><A href="." title="Index">USER COMMANDS</A><TH align=right>EG&nbsp;(&nbsp;1&nbsp;)</TR></TABLE></H4>
2701<HR>
2702<H4><A name="NAME">NAME</A></H4>
2703<DIV class=SH>
2704<!--MAN-INDEX-->eg - test example examples
2705<P>
2706</DIV>
2707<H4><A name="SYNOPSIS">SYNOPSIS</A></H4>
2708<DIV class=SY>
2709<B>eg</B> &#0091; <I>options</I> &#0093;
2710<P>
2711</DIV>
2712<H4><A name="OPTIONS">OPTIONS</A></H4>
2713<DIV class=SH>
2714<DL>
2715<DT>-<B>Q</B>, --<B>quote</B>=<I>style</I><DD><BR>Quote names according to <I>style
2716</I>: The default value is <B>question</B>.
2717</DL>
2718</DIV>
2719<H4><A name="EXAMPLES">EXAMPLES</A></H4>
2720<DIV class=SH>
2721<P>
2722<PRE>
2723<TT>one
2724two</TT>
2725</PRE>
2726<PRE>
2727three
2728four
2729</PRE>
2730<PRE>
2731<I>five
2732six</I>
2733</PRE>
2734</DIV>
2735<H4><A name="SEE ALSO">SEE ALSO</A></H4>
2736<DIV class=SH>
2737<NOBR><A href="../man1/egman.html"><B>egman</B></A>(1)</NOBR>
2738</DIV>
2739<H4><A name="IMPLEMENTATION">IMPLEMENTATION</A></H4>
2740<DIV class=SH>
2741<DL>
2742<DT><A name="version"><B>version</B></A><DD><BR>aha
2743<DT><A name="catalog"><B>catalog</B></A><DD><BR>SpamCo
2744</DL>
2745</DIV>
2746</BODY>
2747</HTML>'
2748	usage=$'[-?\naha\n][-catalog?SpamCo][+NAME?eg - test example examples][Q:quote?Quote names according to \astyle\a:]:[style:=question][+EXAMPLES]{[+dss -x bgp \'(type==\"A\")??{write table > a}::{write cisco > b}\' mrt.dat?Write the announce records from \bmrt.dat\b to the file \ba\b in the \btable\b format and all other records to the file \bb\b in the \bcisco\b format.]}[+SEE ALSO?\begman\b(1), \bwalrus\b(8)]'
2749	EXEC eg "$usage" --html
2750		EXIT 2
2751		OUTPUT - 'return=? option=- name=--html num=0'
2752		ERROR - $'<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2753<HTML>
2754<HEAD>
2755<META name="generator" content="optget (AT&T Research) 2011-11-11">
2756<TITLE>eg man document</TITLE>
2757<STYLE type="text/css">
2758div.SH { padding-left:2em; text-indent:0em; }
2759div.SY { padding-left:4em; text-indent:-2em; }
2760dt { float:left; clear:both; }
2761dd { margin-left:3em; }
2762</STYLE>
2763</HEAD>
2764<BODY bgcolor=white>
2765<H4><TABLE width=100%><TR><TH align=left>EG&nbsp;(&nbsp;1&nbsp;)&nbsp;<TH align=center><A href="." title="Index">USER COMMANDS</A><TH align=right>EG&nbsp;(&nbsp;1&nbsp;)</TR></TABLE></H4>
2766<HR>
2767<H4><A name="NAME">NAME</A></H4>
2768<DIV class=SH>
2769<!--MAN-INDEX-->eg - test example examples
2770<P>
2771</DIV>
2772<H4><A name="SYNOPSIS">SYNOPSIS</A></H4>
2773<DIV class=SY>
2774<B>eg</B> &#0091; <I>options</I> &#0093;
2775<P>
2776</DIV>
2777<H4><A name="OPTIONS">OPTIONS</A></H4>
2778<DIV class=SH>
2779<DL>
2780<DT>-<B>Q</B>, --<B>quote</B>=<I>style</I><DD><BR>Quote names according to <I>style
2781</I>: The default value is <B>question</B>.
2782</DL>
2783</DIV>
2784<H4><A name="EXAMPLES">EXAMPLES</A></H4>
2785<DIV class=SH>
2786<DL>
2787<DT><A name="dss -x bgp \'(type==&quot;A&quot;)?{write table &gt; a}:{write cisco
2788&gt; b}\' mrt.dat"><B>dss -x bgp \'</B>(type==&quot;A&quot;)?{write table &gt;
2789a}:{write cisco &gt; b}\' mrt.dat</A><DD><BR>Write the announce records from <B>mrt.dat
2790</B> to the file <B>a</B> in the <B>table</B> format and all other records to
2791the file <B>b</B> in the <B>cisco</B> format.
2792</DL>
2793</DIV>
2794<H4><A name="SEE ALSO">SEE ALSO</A></H4>
2795<DIV class=SH>
2796<NOBR><A href="../man1/egman.html"><B>egman</B></A>(1),</NOBR>
2797<NOBR><A href="../man8/walrus.html"><B>walrus</B></A>(8)</NOBR>
2798</DIV>
2799<H4><A name="IMPLEMENTATION">IMPLEMENTATION</A></H4>
2800<DIV class=SH>
2801<DL>
2802<DT><A name="version"><B>version</B></A><DD><BR>aha
2803<DT><A name="catalog"><B>catalog</B></A><DD><BR>SpamCo
2804</DL>
2805</DIV>
2806</BODY>
2807</HTML>'
2808
2809TEST 41 'cache exercises'
2810	usage=$'[-1c][a:aaa?AAA][b:bbb?BBB]:[bv][c:ccc?CCC]:?[cv]'
2811	EXEC typeset "$usage" -a -b1
2812		OUTPUT - $'[3] return=a option=-a name=-a arg=(null) num=1
2813[3] return=b option=-b name=-b arg=1 num=1
2814[2] return=a option=-a name=-a arg=(null) num=1
2815[2] return=b option=-b name=-b arg=1 num=1
2816[1] return=a option=-a name=-a arg=(null) num=1
2817[1] return=b option=-b name=-b arg=1 num=1'
2818	EXEC typeset "$usage" -c2 -a
2819		OUTPUT - $'[3] return=c option=-c name=-c arg=2 num=1
2820[3] return=a option=-a name=-a arg=(null) num=1
2821[2] return=c option=-c name=-c arg=2 num=1
2822[2] return=a option=-a name=-a arg=(null) num=1
2823[1] return=c option=-c name=-c arg=2 num=1
2824[1] return=a option=-a name=-a arg=(null) num=1'
2825	EXEC typeset "$usage" -c -a
2826		OUTPUT - $'[3] return=c option=-c name=-c arg=(null) num=0
2827[3] return=a option=-a name=-a arg=(null) num=1
2828[2] return=c option=-c name=-c arg=(null) num=0
2829[2] return=a option=-a name=-a arg=(null) num=1
2830[1] return=c option=-c name=-c arg=(null) num=0
2831[1] return=a option=-a name=-a arg=(null) num=1'
2832	EXEC typeset "$usage" -a -b1 -c -c2
2833		OUTPUT - $'[3] return=a option=-a name=-a arg=(null) num=1
2834[3] return=b option=-b name=-b arg=1 num=1
2835[3] return=c option=-c name=-c arg=(null) num=0
2836[3] return=c option=-c name=-c arg=2 num=1
2837[2] return=a option=-a name=-a arg=(null) num=1
2838[2] return=b option=-b name=-b arg=1 num=1
2839[2] return=c option=-c name=-c arg=(null) num=0
2840[2] return=c option=-c name=-c arg=2 num=1
2841[1] return=a option=-a name=-a arg=(null) num=1
2842[1] return=b option=-b name=-b arg=1 num=1
2843[1] return=c option=-c name=-c arg=(null) num=0
2844[1] return=c option=-c name=-c arg=2 num=1'
2845	usage=$'[-1c]a:[command][n:number]#?[number][s:string]:?[string]'
2846	EXEC typeset "$usage" -n
2847		OUTPUT - $'[3] return=n option=-n name=-n arg=(null) num=1
2848[2] return=n option=-n name=-n arg=(null) num=1
2849[1] return=n option=-n name=-n arg=(null) num=1'
2850	EXEC typeset "$usage" -n12
2851		OUTPUT - $'[3] return=n option=-n name=-n arg=12 num=12
2852[2] return=n option=-n name=-n arg=12 num=12
2853[1] return=n option=-n name=-n arg=12 num=12'
2854	EXEC typeset "$usage" -s
2855		OUTPUT - $'[3] return=s option=-s name=-s arg=(null) num=1
2856[2] return=s option=-s name=-s arg=(null) num=1
2857[1] return=s option=-s name=-s arg=(null) num=1'
2858	EXEC typeset "$usage" -s12
2859		OUTPUT - $'[3] return=s option=-s name=-s arg=12 num=1
2860[2] return=s option=-s name=-s arg=12 num=1
2861[1] return=s option=-s name=-s arg=12 num=1'
2862	EXEC typeset "$usage" OPT --foo
2863		OUTPUT - $'[3] argument=1 value="OPT"
2864[3] argument=2 value="--foo"
2865[2] argument=1 value="OPT"
2866[2] argument=2 value="--foo"
2867[1] argument=1 value="OPT"
2868[1] argument=2 value="--foo"'
2869	EXEC typeset "$usage" -a locate OPT --foo
2870		OUTPUT - $'[3] return=a option=-a name=-a arg=locate num=1
2871[3] argument=1 value="OPT"
2872[3] argument=2 value="--foo"
2873[2] return=a option=-a name=-a arg=locate num=1
2874[2] argument=1 value="OPT"
2875[2] argument=2 value="--foo"
2876[1] return=a option=-a name=-a arg=locate num=1
2877[1] argument=1 value="OPT"
2878[1] argument=2 value="--foo"'
2879	usage=$'[-1c][L]#?[n?Left justify.][Z]#?[n?Zero fill.]'
2880	EXEC typeset "$usage" -Z -L -L -Z -L foo=bar
2881		OUTPUT - '[3] return=Z option=-Z name=-Z arg=(null) num=0
2882[3] return=L option=-L name=-L arg=(null) num=0
2883[3] return=L option=-L name=-L arg=(null) num=0
2884[3] return=Z option=-Z name=-Z arg=(null) num=0
2885[3] return=L option=-L name=-L arg=(null) num=0
2886[3] argument=1 value="foo=bar"
2887[2] return=Z option=-Z name=-Z arg=(null) num=0
2888[2] return=L option=-L name=-L arg=(null) num=0
2889[2] return=L option=-L name=-L arg=(null) num=0
2890[2] return=Z option=-Z name=-Z arg=(null) num=0
2891[2] return=L option=-L name=-L arg=(null) num=0
2892[2] argument=1 value="foo=bar"
2893[1] return=Z option=-Z name=-Z arg=(null) num=0
2894[1] return=L option=-L name=-L arg=(null) num=0
2895[1] return=L option=-L name=-L arg=(null) num=0
2896[1] return=Z option=-Z name=-Z arg=(null) num=0
2897[1] return=L option=-L name=-L arg=(null) num=0
2898[1] argument=1 value="foo=bar"'
2899
2900TEST 42 'optional long names'
2901	usage=$'[-][a:aaa][b:bbb?BBB][c?CCC][d:?DDD][e\f:n:eee\f][f\f:y:fff\f?FFF][g:ggg?GGG]'
2902	EXEC tst "$usage" -a --aaa -b --bbb -c -d -e --eee -f --fff -g -ggg
2903		OUTPUT - $'return=a option=-a name=-a arg=(null) num=1
2904return=a option=-a name=--aaa arg=(null) num=1
2905return=b option=-b name=-b arg=(null) num=1
2906return=b option=-b name=--bbb arg=(null) num=1
2907return=c option=-c name=-c arg=(null) num=1
2908return=d option=-d name=-d arg=(null) num=1
2909return=e option=-e name=-e arg=(null) num=1
2910return=e option=-e name=--eee arg=(null) num=1
2911return=f option=-f name=-f arg=(null) num=1
2912return=f option=-f name=--fff arg=(null) num=1
2913return=g option=-g name=-g arg=(null) num=1
2914return=g option=-g name=-g arg=(null) num=1
2915return=g option=-g name=-g arg=(null) num=1
2916return=g option=-g name=-g arg=(null) num=1'
2917	EXEC tst "$usage" --man
2918		EXIT 2
2919		OUTPUT - $'return=? option=- name=--man num=0'
2920		ERROR - $'SYNOPSIS
2921  tst [ options ]
2922
2923OPTIONS
2924  -a, --aaa
2925  -b, --bbb       BBB
2926  -c              CCC
2927  -d              DDD
2928  -e
2929  -f, --fff       FFF
2930  -g, --ggg       GGG'
2931	usage=$'[-][a:aaa]:[av][b:bbb?BBB]:[bv][c?CCC]:[cv][d:?DDD]:[dv][e\f:n:eee\f]:[ev][f\f:y:fff\f?FFF]:[fv][g:ggg?GGG]:[gv]'
2932	EXEC tst "$usage" -a AV --aaa=LAV -bBV --bbb=LBV -c CV -dDV -e EV --eee LEV -f FV --fff=LFV -gGV -ggg LGV
2933		EXIT 0
2934		OUTPUT - $'return=a option=-a name=-a arg=AV num=1
2935return=a option=-a name=--aaa arg=LAV num=1
2936return=b option=-b name=-b arg=BV num=1
2937return=b option=-b name=--bbb arg=LBV num=1
2938return=c option=-c name=-c arg=CV num=1
2939return=d option=-d name=-d arg=DV num=1
2940return=e option=-e name=-e arg=EV num=1
2941return=e option=-e name=--eee arg=LEV num=1
2942return=f option=-f name=-f arg=FV num=1
2943return=f option=-f name=--fff arg=LFV num=1
2944return=g option=-g name=-g arg=GV num=1
2945return=g option=-g name=-g arg=gg num=1
2946argument=1 value="LGV"'
2947		ERROR -
2948	EXEC tst "$usage" --man
2949		EXIT 2
2950		OUTPUT - $'return=? option=- name=--man num=0'
2951		ERROR - $'SYNOPSIS
2952  tst [ options ]
2953
2954OPTIONS
2955  -a, --aaa=av
2956  -b, --bbb=bv    BBB
2957  -c cv           CCC
2958  -d dv           DDD
2959  -e ev
2960  -f, --fff=fv    FFF
2961  -g, --ggg=gv    GGG'
2962
2963TEST 43 'trailing wild card'
2964	usage=$'[-][z:zzz]:[style][A:a*][B:b*][C:c*]'
2965	EXEC wild "$usage" -A -B -C --a --b --c --axx --bxx --cxx
2966		OUTPUT - $'return=A option=-A name=-A arg=(null) num=1
2967return=B option=-B name=-B arg=(null) num=1
2968return=C option=-C name=-C arg=(null) num=1
2969return=A option=-A name=--a arg=(null) num=1
2970return=B option=-B name=--b arg=(null) num=1
2971return=C option=-C name=--c arg=(null) num=1
2972return=A option=-A name=--axx arg=(null) num=1
2973return=B option=-B name=--bxx arg=(null) num=1
2974return=C option=-C name=--cxx arg=(null) num=1'
2975
2976	(
2977		export LC_ALL=en_US
2978		EXEC wild "$usage" -A -B -C --a --b --c --axx --bxx --cxx
2979	)
2980
2981	usage=$'[-][z:zzz]:[style]{[A:a*][B:b*][C:c*]}'
2982	EXEC wild "$usage" -z A -z B -z C -z a -z b -z c -z axx -z bxx -z cxx
2983		OUTPUT - $'return=z option=-z name=-z arg=A num=65
2984return=z option=-z name=-z arg=B num=66
2985return=z option=-z name=-z arg=C num=67
2986return=z option=-z name=-z arg=a num=65
2987return=z option=-z name=-z arg=b num=66
2988return=z option=-z name=-z arg=c num=67
2989return=z option=-z name=-z arg=axx num=65
2990return=z option=-z name=-z arg=bxx num=66
2991return=z option=-z name=-z arg=cxx num=67'
2992	usage=$'[-][z:zzz]:[style]{[A:a*?aaa][B:b*?bbb][C:c*?ccc]}'
2993	EXEC wild "$usage" -z A -z B -z C -z a -z b -z c -z axx -z bxx -z cxx
2994	EXEC wild "$usage" -z
2995		EXIT 1
2996		OUTPUT - $'return=: option=-z name=-z num=0'
2997		ERROR - $'wild: -z: style argument expected'
2998	EXEC wild "$usage" --zzz
2999		OUTPUT - $'return=: option=-z name=--zzz num=0'
3000		ERROR - $'wild: --zzz: style value expected'
3001	usage=$'[-][z:zzz]:[style]{[A:a\aget\a?aaa][B:b\aoutta\a?bbb][C:c\atown\a?ccc]}'
3002	EXEC wild "$usage" -z A -z B -z C -z a -z b -z c -z axx -z bxx -z cxx
3003		EXIT 0
3004		OUTPUT - $'return=z option=-z name=-z arg=A num=65
3005return=z option=-z name=-z arg=B num=66
3006return=z option=-z name=-z arg=C num=67
3007return=z option=-z name=-z arg=a num=65
3008return=z option=-z name=-z arg=b num=66
3009return=z option=-z name=-z arg=c num=67
3010return=z option=-z name=-z arg=axx num=65
3011return=z option=-z name=-z arg=bxx num=66
3012return=z option=-z name=-z arg=cxx num=67'
3013		ERROR -
3014	EXEC wild "$usage" -z
3015		EXIT 1
3016		OUTPUT - $'return=: option=-z name=-z num=0'
3017		ERROR - $'wild: -z: style argument expected'
3018	EXEC wild "$usage" --zzz
3019		OUTPUT - $'return=: option=-z name=--zzz num=0'
3020		ERROR - $'wild: --zzz: style value expected'
3021	EXEC wild "$usage" --man
3022		EXIT 2
3023		OUTPUT - $'return=? option=- name=--man num=0'
3024		ERROR - $'SYNOPSIS
3025  wild [ options ]
3026
3027OPTIONS
3028  -z, --zzz=style
3029                    A|aget
3030                          aaa
3031                    B|boutta
3032                          bbb
3033                    C|ctown
3034                          ccc'
3035
3036TEST 44 'getopt_long() compatibility'
3037	usage=$'[-1p1]\n[h:help]\n[V:version]\n[v:verbose]\n[X]\n[259:save-temps]\n[s:std]:[string]\n[d:debug]\n[262:static]\n[263:dynamic]\n[264:free]\n[265:fixed]\n[266:column]:[string]\n[267:MT]:[string]\n[268:MF]:[string]\n[269:fmain]\n[270:fno-main]\n[W:Wall]\n[272:Wobsolete]\n[273:Wno-obsolete]\n[274:Warchaic]\n[275:Wno-archaic]\n[276:Wcolumn-overflow]\n[277:Wno-column-overflow]\n[278:Wconstant]\n[279:Wno-constant]\n[280:Wparentheses]\n[281:Wno-parentheses]\n[282:Wimplicit-terminator]\n[283:Wno-implicit-terminator]\n[284:Wstrict-typing]\n[285:Wno-strict-typing]\n[?]\n[E]\n[P]\n[C]\n[S]\n[c]\n[m]\n[g]\n[o]:[]\n[I]:[]\n'
3038	EXEC cobcc "$usage" -static -I foo -Ibar -debug -C -Wparen tst.cob
3039		OUTPUT - $'return=-262 option=-262 name=-static arg=(null) num=1
3040return=I option=-262 name=-I arg=foo num=1
3041return=I option=-262 name=-I arg=bar num=1
3042return=d option=-d name=-debug arg=(null) num=1
3043return=C option=-d name=-C arg=(null) num=1
3044return=-280 option=-280 name=-Wparentheses arg=(null) num=1
3045argument=1 value="tst.cob"'
3046
3047TEST 45 'n=v vs. n:=v'
3048	usage=$'[-][a:aaa?AAA]:[vvv]'
3049	EXEC pax "$usage" -a 1 --a=xx --a:=yy
3050		OUTPUT - $'return=a option=-a name=-a arg=1 num=1
3051return=a option=-a name=--aaa arg=xx num=1
3052return=a option=-a name=--aaa arg:=yy num=1'
3053	EXEC pax "$usage" -a 1 --aaa=xx --aaa:=yy
3054
3055TEST 46 'html escapism'
3056	usage=$'[-][+NAME?codex - encode/decode filter][+?Methods:]{[+and?things]{[+of?this <= 64.]:[nature][+govern?ator]}}\n\n[ [ <,> ] method [ <,>,| method ... ] ]\n\n[+SEE ALSO?\bcodex\b(3), \bvcodex\b(3)]'
3057	EXEC codex "$usage" --html
3058		EXIT 2
3059		OUTPUT - $'return=? option=- name=--html num=0'
3060		ERROR - $'<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
3061<HTML>
3062<HEAD>
3063<META name="generator" content="optget (AT&T Research) 2011-11-11">
3064<TITLE>codex man document</TITLE>
3065<STYLE type="text/css">
3066div.SH { padding-left:2em; text-indent:0em; }
3067div.SY { padding-left:4em; text-indent:-2em; }
3068dt { float:left; clear:both; }
3069dd { margin-left:3em; }
3070</STYLE>
3071</HEAD>
3072<BODY bgcolor=white>
3073<H4><TABLE width=100%><TR><TH align=left>CODEX&nbsp;(&nbsp;1&nbsp;)&nbsp;<TH align=center><A href="." title="Index">USER COMMANDS</A><TH align=right>CODEX&nbsp;(&nbsp;1&nbsp;)</TR></TABLE></H4>
3074<HR>
3075<H4><A name="NAME">NAME</A></H4>
3076<DIV class=SH>
3077<!--MAN-INDEX-->codex - encode/decode filter
3078<P>
3079</DIV>
3080<H4><A name="SYNOPSIS">SYNOPSIS</A></H4>
3081<DIV class=SY>
3082<B>codex</B> &#0091; <I>options</I> &#0093; &#0091; &#0091; &lt;,&gt; &#0093; method &#0091; &lt;,&gt;,| method ...
3083&#0093; &#0093;
3084<P>
3085Methods:
3086<DL>
3087<DT><A name="and"><B>and</B></A><DD>things
3088<DL>
3089<DT><A name="of=nature"><B>of=<I>nature</I></B></A><DD><BR>this &lt;= 64.
3090<DT><A name="govern"><B>govern</B></A><DD><BR>ator
3091</DL>
3092</DL>
3093</DIV>
3094<H4><A name="SEE ALSO">SEE ALSO</A></H4>
3095<DIV class=SH>
3096<NOBR><A href="../man3/codex.html"><B>codex</B></A>(3),</NOBR>
3097<NOBR><A href="../man3/vcodex.html"><B>vcodex</B></A>(3)</NOBR>
3098</DIV>
3099</BODY>
3100</HTML>'
3101
3102TEST 47 'omitted optional arg default'
3103	usage1=$'[-][101:clobber?Clobber pattern.]:?[pattern:=*.exe:!*][102:select?Select pattern.]:[pattern=*.[ch]]]'
3104	usage2=$'[-][101:clobber?Clobber pattern.]:?[pattern:!*:=*.exe][102:select?Select pattern.]:[pattern=*.[ch]]]'
3105	EXEC make "$usage1" --clobber foo
3106		OUTPUT - $'return=-101 option=-101 name=--clobber arg=* num=1\nargument=1 value="foo"'
3107	EXEC make "$usage2" --clobber foo
3108	EXEC make "$usage1" --clobber=1 bar
3109		OUTPUT - $'return=-101 option=-101 name=--clobber arg=* num=1\nargument=1 value="bar"'
3110	EXEC make "$usage2" --clobber=1 bar
3111	EXEC make "$usage1" --noclobber foo
3112		OUTPUT - $'return=-101 option=-101 name=--clobber arg=(null) num=0\nargument=1 value="foo"'
3113	EXEC make "$usage2" --noclobber foo
3114	EXEC make "$usage1" --clobber=0 bar
3115		OUTPUT - $'return=-101 option=-101 name=--clobber arg=(null) num=0\nargument=1 value="bar"'
3116	EXEC make "$usage2" --clobber=0 bar
3117	EXEC make "$usage1" --clobber=foo bar
3118		OUTPUT - $'return=-101 option=-101 name=--clobber arg=foo num=1\nargument=1 value="bar"'
3119	EXEC make "$usage2" --clobber=foo bar
3120	EXEC make "$usage1" --select foo bar
3121		OUTPUT - $'return=-102 option=-102 name=--select arg=foo num=1\nargument=1 value="bar"'
3122	EXEC make "$usage2" --select foo bar
3123	EXEC make "$usage1" --select=foo bar
3124	EXEC make "$usage2" --select=foo bar
3125	EXEC make "$usage1" --?clobber
3126		OUTPUT - $'return=? option=-? name=--?clobber num=0'
3127		ERROR - $'Usage: make [ options ]
3128OPTIONS
3129  --clobber[=pattern]
3130                  Clobber pattern. If the option value is omitted then * is
3131                  assumed. The default value is *.exe.'
3132		  EXIT 2
3133	EXEC make "$usage2" --?clobber
3134	EXEC make "$usage1" --?select
3135		OUTPUT - $'return=? option=-? name=--?select num=0'
3136		ERROR - $'Usage: make [ options ]
3137OPTIONS
3138  --select=pattern=*.[ch]
3139                  Select pattern.'
3140	EXEC make "$usage2" --?select
3141	EXEC make "$usage1" --man
3142		OUTPUT - $'return=? option=- name=--man num=0'
3143		ERROR - $'SYNOPSIS
3144  make [ options ]
3145
3146OPTIONS
3147  --clobber[=pattern]
3148                  Clobber pattern. If the option value is omitted then * is
3149                  assumed. The default value is *.exe.
3150  --select=pattern=*.[ch]
3151                  Select pattern.'
3152	EXEC make "$usage2" --man
3153	EXEC make "$usage1" --html
3154		OUTPUT - $'return=? option=- name=--html num=0'
3155		ERROR - $'<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
3156<HTML>
3157<HEAD>
3158<META name="generator" content="optget (AT&T Research) 2011-11-11">
3159<TITLE>make man document</TITLE>
3160<STYLE type="text/css">
3161div.SH { padding-left:2em; text-indent:0em; }
3162div.SY { padding-left:4em; text-indent:-2em; }
3163dt { float:left; clear:both; }
3164dd { margin-left:3em; }
3165</STYLE>
3166</HEAD>
3167<BODY bgcolor=white>
3168<H4><TABLE width=100%><TR><TH align=left>MAKE&nbsp;(&nbsp;1&nbsp;)&nbsp;<TH align=center><A href="." title="Index">USER COMMANDS</A><TH align=right>MAKE&nbsp;(&nbsp;1&nbsp;)</TR></TABLE></H4>
3169<HR>
3170<H4><A name="SYNOPSIS">SYNOPSIS</A></H4>
3171<DIV class=SY>
3172<B>make</B> &#0091; <I>options</I> &#0093;
3173</DIV>
3174<P>
3175<H4><A name="OPTIONS">OPTIONS</A></H4>
3176<DIV class=SH>
3177<DL>
3178<DT>--<B>clobber</B>&#0091;=<I>pattern</I>&#0093;<DD><BR>Clobber pattern. If the option value
3179is omitted then <B>*</B> is assumed. The default value is <B>*.exe</B>.
3180<DT>--<B>select</B>=<I>pattern=*.&#0091;ch&#0093;</I><DD><BR>Select pattern.
3181</DL>
3182</DIV>
3183</BODY>
3184</HTML>'
3185	EXEC make "$usage2" --html
3186
3187TEST 48 'ambiguous trio'
3188	usage=$'[-][x:aha?AHA.][y:aha1?AHA1][z:aha2?AHA2]'
3189	EXEC huh "$usage" --aha
3190		OUTPUT - $'return=x option=-x name=--aha arg=(null) num=1'
3191	EXEC huh "$usage" --noaha
3192		OUTPUT - $'return=x option=-x name=--aha arg=(null) num=0'
3193	EXEC huh "$usage" --aha1
3194		OUTPUT - $'return=y option=-y name=--aha1 arg=(null) num=1'
3195	EXEC huh "$usage" --noaha1
3196		OUTPUT - $'return=y option=-y name=--aha1 arg=(null) num=0'
3197	EXEC huh "$usage" --ah
3198		OUTPUT - $'return=: option=-x name=--ah num=0'
3199		ERROR - $'huh: --ah: ambiguous option'
3200		EXIT 1
3201	EXEC huh "$usage" --noah
3202		OUTPUT - $'return=: option=-x name=--noah num=0'
3203		ERROR - $'huh: --noah: ambiguous option'
3204
3205TEST 49 'the long and short of it'
3206	usage=$'[-][a:archive-clean][b:archive-clobber]'
3207	EXEC make "$usage" --archive-clean --acle --aclo --ar-clobber --arcle --arclo
3208		OUTPUT - $'return=a option=-a name=--archive-clean arg=(null) num=1
3209return=a option=-a name=--archive-clean arg=(null) num=1
3210return=b option=-b name=--archive-clobber arg=(null) num=1
3211return=b option=-b name=--archive-clobber arg=(null) num=1
3212return=a option=-a name=--archive-clean arg=(null) num=1
3213return=b option=-b name=--archive-clobber arg=(null) num=1'
3214	EXEC make "$usage" --archive_clean --acle --aclo --ar_clobber --arcle --arclo
3215	EXEC make "$usage" --ac --ac --a-c --ar-c --arc --arcl
3216		OUTPUT - $'return=: option=-a name=--ac num=0
3217return=: option=-a name=--ac num=0
3218return=: option=-a name=--a-c num=0
3219return=: option=-a name=--ar-c num=0
3220return=: option=-a name=--arc num=0
3221return=: option=-a name=--arcl num=0'
3222		ERROR - $'make: --ac: ambiguous option
3223make: --ac: ambiguous option
3224make: --a-c: ambiguous option
3225make: --ar-c: ambiguous option
3226make: --arc: ambiguous option
3227make: --arcl: ambiguous option'
3228		EXIT 1
3229	EXEC make "$usage" --ac --ac --a_c --ar_c --arc --arcl
3230		OUTPUT - $'return=: option=-a name=--ac num=0
3231return=: option=-a name=--ac num=0
3232return=: option=-a name=--a_c num=0
3233return=: option=-a name=--ar_c num=0
3234return=: option=-a name=--arc num=0
3235return=: option=-a name=--arcl num=0'
3236		ERROR - $'make: --ac: ambiguous option
3237make: --ac: ambiguous option
3238make: --a_c: ambiguous option
3239make: --ar_c: ambiguous option
3240make: --arc: ambiguous option
3241make: --arcl: ambiguous option'
3242	usage=$'[-][a:archive-clean]'
3243	EXEC make "$usage" --archive-clean --ac --a-c --ar-c --arc --ar-clean --arclean
3244		OUTPUT - $'return=a option=-a name=--archive-clean arg=(null) num=1
3245return=a option=-a name=--archive-clean arg=(null) num=1
3246return=a option=-a name=--archive-clean arg=(null) num=1
3247return=a option=-a name=--archive-clean arg=(null) num=1
3248return=a option=-a name=--archive-clean arg=(null) num=1
3249return=a option=-a name=--archive-clean arg=(null) num=1
3250return=a option=-a name=--archive-clean arg=(null) num=1'
3251		ERROR -
3252		EXIT 0
3253	EXEC make "$usage" --archive_clean --ac --a_c --ar_c --arc --ar_clean --arclean
3254	EXEC make "$usage" --?archive-clean --?a-c --?ac --?ar-c --?arc --?ar-clean --?arclean
3255		OUTPUT - $'return=? option=-? name=--?archive-clean num=0'
3256		ERROR - $'Usage: make [ options ]
3257OPTIONS
3258  -a, --archive-clean'
3259		EXIT 2
3260	EXEC make "$usage" --?archive_clean --?a_c --?ac --?ar_c --?arc --?ar_clean --?arclean
3261		OUTPUT - $'return=? option=-? name=--?archive_clean num=0'
3262	EXEC make "$usage" --?a-c
3263		OUTPUT - $'return=? option=-? name=--?a-c num=0'
3264	EXEC make "$usage" --?a_c
3265		OUTPUT - $'return=? option=-? name=--?a_c num=0'
3266	EXEC make "$usage" --?ac
3267		OUTPUT - $'return=? option=-? name=--?ac num=0'
3268	EXEC make "$usage" --?ar-c
3269		OUTPUT - $'return=? option=-? name=--?ar-c num=0'
3270	EXEC make "$usage" --?ar_c
3271		OUTPUT - $'return=? option=-? name=--?ar_c num=0'
3272	EXEC make "$usage" --?arc
3273		OUTPUT - $'return=? option=-? name=--?arc num=0'
3274	EXEC make "$usage" --?ar-clean
3275		OUTPUT - $'return=? option=-? name=--?ar-clean num=0'
3276	EXEC make "$usage" --?ar_clean
3277		OUTPUT - $'return=? option=-? name=--?ar_clean num=0'
3278	EXEC make "$usage" --?arclean
3279		OUTPUT - $'return=? option=-? name=--?arclean num=0'
3280	usage=$'[-][a:ArchiveClean]'
3281	EXEC make "$usage" --?ArchiveClean --?AC --?Arc --?ArC --?ArClean --?ArcClean
3282		OUTPUT - $'return=? option=-? name=--?ArchiveClean num=0'
3283		ERROR - $'Usage: make [ options ]
3284OPTIONS
3285  -a, --ArchiveClean'
3286	EXEC make "$usage" --?AC
3287		OUTPUT - $'return=? option=-? name=--?AC num=0'
3288	EXEC make "$usage" --?Arc
3289		OUTPUT - $'return=? option=-? name=--?Arc num=0'
3290	EXEC make "$usage" --?ArC
3291		OUTPUT - $'return=? option=-? name=--?ArC num=0'
3292	EXEC make "$usage" --?ArClean
3293		OUTPUT - $'return=? option=-? name=--?ArClean num=0'
3294	EXEC make "$usage" --?ArcClean
3295		OUTPUT - $'return=? option=-? name=--?ArcClean num=0'
3296
3297TEST 50 'the underscored long and short of it'
3298	usage=$'[-][a:archive_clean][b:archive_clobber]'
3299	EXEC make "$usage" --archive-clean --acle --aclo --ar-clobber --arcle --arclo
3300		OUTPUT - $'return=a option=-a name=--archive_clean arg=(null) num=1
3301return=a option=-a name=--archive_clean arg=(null) num=1
3302return=b option=-b name=--archive_clobber arg=(null) num=1
3303return=b option=-b name=--archive_clobber arg=(null) num=1
3304return=a option=-a name=--archive_clean arg=(null) num=1
3305return=b option=-b name=--archive_clobber arg=(null) num=1'
3306	EXEC make "$usage" --archive_clean --acle --aclo --ar_clobber --arcle --arclo
3307	EXEC make "$usage" --ac --ac --a-c --ar-c --arc --arcl
3308		OUTPUT - $'return=: option=-a name=--ac num=0
3309return=: option=-a name=--ac num=0
3310return=: option=-a name=--a-c num=0
3311return=: option=-a name=--ar-c num=0
3312return=: option=-a name=--arc num=0
3313return=: option=-a name=--arcl num=0'
3314		ERROR - $'make: --ac: ambiguous option
3315make: --ac: ambiguous option
3316make: --a-c: ambiguous option
3317make: --ar-c: ambiguous option
3318make: --arc: ambiguous option
3319make: --arcl: ambiguous option'
3320		EXIT 1
3321	EXEC make "$usage" --ac --ac --a_c --ar_c --arc --arcl
3322		OUTPUT - $'return=: option=-a name=--ac num=0
3323return=: option=-a name=--ac num=0
3324return=: option=-a name=--a_c num=0
3325return=: option=-a name=--ar_c num=0
3326return=: option=-a name=--arc num=0
3327return=: option=-a name=--arcl num=0'
3328		ERROR - $'make: --ac: ambiguous option
3329make: --ac: ambiguous option
3330make: --a_c: ambiguous option
3331make: --ar_c: ambiguous option
3332make: --arc: ambiguous option
3333make: --arcl: ambiguous option'
3334	usage=$'[-][a:archive_clean]'
3335	EXEC make "$usage" --archive-clean --ac --a-c --ar-c --arc --ar-clean --arclean
3336		OUTPUT - $'return=a option=-a name=--archive_clean arg=(null) num=1
3337return=a option=-a name=--archive_clean arg=(null) num=1
3338return=a option=-a name=--archive_clean arg=(null) num=1
3339return=a option=-a name=--archive_clean arg=(null) num=1
3340return=a option=-a name=--archive_clean arg=(null) num=1
3341return=a option=-a name=--archive_clean arg=(null) num=1
3342return=a option=-a name=--archive_clean arg=(null) num=1'
3343		ERROR -
3344		EXIT 0
3345	EXEC make "$usage" --archive_clean --ac --a_c --ar_c --arc --ar_clean --arclean
3346	EXEC make "$usage" --?archive-clean --?a-c --?ac --?ar-c --?arc --?ar-clean --?arclean
3347		OUTPUT - $'return=? option=-? name=--?archive-clean num=0'
3348		ERROR - $'Usage: make [ options ]
3349OPTIONS
3350  -a, --archive_clean'
3351		EXIT 2
3352	EXEC make "$usage" --?archive_clean --?a_c --?ac --?ar_c --?arc --?ar_clean --?arclean
3353		OUTPUT - $'return=? option=-? name=--?archive_clean num=0'
3354	EXEC make "$usage" --?a-c
3355		OUTPUT - $'return=? option=-? name=--?a-c num=0'
3356	EXEC make "$usage" --?a_c
3357		OUTPUT - $'return=? option=-? name=--?a_c num=0'
3358	EXEC make "$usage" --?ac
3359		OUTPUT - $'return=? option=-? name=--?ac num=0'
3360	EXEC make "$usage" --?ar-c
3361		OUTPUT - $'return=? option=-? name=--?ar-c num=0'
3362	EXEC make "$usage" --?ar_c
3363		OUTPUT - $'return=? option=-? name=--?ar_c num=0'
3364	EXEC make "$usage" --?arc
3365		OUTPUT - $'return=? option=-? name=--?arc num=0'
3366	EXEC make "$usage" --?ar-clean
3367		OUTPUT - $'return=? option=-? name=--?ar-clean num=0'
3368	EXEC make "$usage" --?ar_clean
3369		OUTPUT - $'return=? option=-? name=--?ar_clean num=0'
3370	EXEC make "$usage" --?arclean
3371		OUTPUT - $'return=? option=-? name=--?arclean num=0'
3372
3373TEST 51 'the suboption long and short of it'
3374	usage=$'[-][z:time-style?Time style.]:[style]{[11:iso?Iso.][12:posix-iso?Posix iso.][13:full-iso?Full iso.][14:full-numeric?Full numeric.]}'
3375	EXEC make "$usage" --time-style=iso --ts=i --time-style=full-iso --ts=fi --ts=fn --time-style=full-numeric -z fnumeric -z fulnumeric -z fuln -z fulln --timestyle=fullnumeric
3376		OUTPUT - $'return=z option=-z name=--time-style arg=iso num=-11
3377return=z option=-z name=--time-style arg=i num=-11
3378return=z option=-z name=--time-style arg=full-iso num=-13
3379return=z option=-z name=--time-style arg=fi num=-13
3380return=z option=-z name=--time-style arg=fn num=-14
3381return=z option=-z name=--time-style arg=full-numeric num=-14
3382return=z option=-z name=-z arg=fnumeric num=-14
3383return=z option=-z name=-z arg=fulnumeric num=-14
3384return=z option=-z name=-z arg=fuln num=-14
3385return=z option=-z name=-z arg=fulln num=-14
3386return=z option=-z name=--time-style arg=fullnumeric num=-14'
3387	EXEC make "$usage" --time_style=iso --ts=i --time_style=full_iso --ts=fi --ts=fn --time_style=full_numeric -z fnumeric -z fulnumeric -z fuln -z fulln --timestyle=fullnumeric
3388		OUTPUT - $'return=z option=-z name=--time-style arg=iso num=-11
3389return=z option=-z name=--time-style arg=i num=-11
3390return=z option=-z name=--time-style arg=full_iso num=-13
3391return=z option=-z name=--time-style arg=fi num=-13
3392return=z option=-z name=--time-style arg=fn num=-14
3393return=z option=-z name=--time-style arg=full_numeric num=-14
3394return=z option=-z name=-z arg=fnumeric num=-14
3395return=z option=-z name=-z arg=fulnumeric num=-14
3396return=z option=-z name=-z arg=fuln num=-14
3397return=z option=-z name=-z arg=fulln num=-14
3398return=z option=-z name=--time-style arg=fullnumeric num=-14'
3399
3400TEST 52 'the underscored suboption long and short of it'
3401	usage=$'[-][z:time_style?Time style.]:[style]{[11:iso?Iso.][12:posix_iso?Posix iso.][13:full_iso?Full iso.][14:full_numeric?Full numeric.]}'
3402	EXEC make "$usage" --time-style=iso --ts=i --time-style=full-iso --ts=fi --ts=fn --time-style=full-numeric -z fnumeric -z fulnumeric -z fuln -z fulln --timestyle=fullnumeric
3403		OUTPUT - $'return=z option=-z name=--time_style arg=iso num=-11
3404return=z option=-z name=--time_style arg=i num=-11
3405return=z option=-z name=--time_style arg=full-iso num=-13
3406return=z option=-z name=--time_style arg=fi num=-13
3407return=z option=-z name=--time_style arg=fn num=-14
3408return=z option=-z name=--time_style arg=full-numeric num=-14
3409return=z option=-z name=-z arg=fnumeric num=-14
3410return=z option=-z name=-z arg=fulnumeric num=-14
3411return=z option=-z name=-z arg=fuln num=-14
3412return=z option=-z name=-z arg=fulln num=-14
3413return=z option=-z name=--time_style arg=fullnumeric num=-14'
3414	EXEC make "$usage" --time_style=iso --ts=i --time_style=full_iso --ts=fi --ts=fn --time_style=full_numeric -z fnumeric -z fulnumeric -z fuln -z fulln --timestyle=fullnumeric
3415		OUTPUT - $'return=z option=-z name=--time_style arg=iso num=-11
3416return=z option=-z name=--time_style arg=i num=-11
3417return=z option=-z name=--time_style arg=full_iso num=-13
3418return=z option=-z name=--time_style arg=fi num=-13
3419return=z option=-z name=--time_style arg=fn num=-14
3420return=z option=-z name=--time_style arg=full_numeric num=-14
3421return=z option=-z name=-z arg=fnumeric num=-14
3422return=z option=-z name=-z arg=fulnumeric num=-14
3423return=z option=-z name=-z arg=fuln num=-14
3424return=z option=-z name=-z arg=fulln num=-14
3425return=z option=-z name=--time_style arg=fullnumeric num=-14'
3426
3427TEST 53 'dashing long name input separator ingeniousness'
3428	usage=$'[-][p:prefixinclude?PREFIX-INCLUDE]'
3429	EXEC make "$usage" --prefixinclude --prefix-include --pre-fix-inc-lude
3430		OUTPUT - $'return=p option=-p name=--prefixinclude arg=(null) num=1
3431return=p option=-p name=--prefixinclude arg=(null) num=1
3432return=p option=-p name=--prefixinclude arg=(null) num=1'
3433	EXEC make "$usage" --prefixinclude --prefix_include --pre_fix_inc_lude
3434	EXEC make "$usage" --prefixinclude --prefix_include --pre_fix-inc_lude
3435	EXEC make "$usage" --?prefixinclude
3436		OUTPUT - $'return=? option=-? name=--?prefixinclude num=0'
3437		ERROR - $'Usage: make [ options ]
3438OPTIONS
3439  -p, --prefixinclude
3440                  PREFIX-INCLUDE'
3441		EXIT 2
3442	EXEC make "$usage" --?prefix-include
3443		OUTPUT - $'return=? option=-? name=--?prefix-include num=0'
3444	EXEC make "$usage" --?pre-fix-inc-lude
3445		OUTPUT - $'return=? option=-? name=--?pre-fix-inc-lude num=0'
3446	EXEC make "$usage" --?pre_fix_inc_lude
3447		OUTPUT - $'return=? option=-? name=--?pre_fix_inc_lude num=0'
3448	EXEC make "$usage" --?pre_fix-inc_lude
3449		OUTPUT - $'return=? option=-? name=--?pre_fix-inc_lude num=0'
3450	usage=$'[-][p:pre-fix_inc-lude?PREFIX-INCLUDE]'
3451	EXEC make "$usage" --prefixinclude --prefix-include --pre-fix-inc-lude
3452		OUTPUT - $'return=p option=-p name=--pre-fix_inc-lude arg=(null) num=1
3453return=p option=-p name=--pre-fix_inc-lude arg=(null) num=1
3454return=p option=-p name=--pre-fix_inc-lude arg=(null) num=1'
3455		ERROR -
3456		EXIT 0
3457	EXEC make "$usage" --prefixinclude --prefix_include --pre_fix_inc_lude
3458	EXEC make "$usage" --prefixinclude --prefix_include --pre_fix-inc_lude
3459	EXEC make "$usage" --?prefixinclude
3460		OUTPUT - $'return=? option=-? name=--?prefixinclude num=0'
3461		ERROR - $'Usage: make [ options ]
3462OPTIONS
3463  -p, --pre-fix_inc-lude
3464                  PREFIX-INCLUDE'
3465		EXIT 2
3466	EXEC make "$usage" --?prefix-include
3467		OUTPUT - $'return=? option=-? name=--?prefix-include num=0'
3468	EXEC make "$usage" --?pre-fix-inc-lude
3469		OUTPUT - $'return=? option=-? name=--?pre-fix-inc-lude num=0'
3470	EXEC make "$usage" --?pre_fix_inc_lude
3471		OUTPUT - $'return=? option=-? name=--?pre_fix_inc_lude num=0'
3472	EXEC make "$usage" --?pre_fix-inc_lude
3473		OUTPUT - $'return=? option=-? name=--?pre_fix-inc_lude num=0'
3474
3475TEST 54 'boolean option with numeric value'
3476	usage=$'[-][103:reread]'
3477	EXEC make "$usage" --reread --noreread --reread=0 --reread=1 --reread=2
3478		OUTPUT - $'return=-103 option=-103 name=--reread arg=(null) num=1
3479return=-103 option=-103 name=--reread arg=(null) num=0
3480return=-103 option=-103 name=--reread arg=(null) num=0
3481return=-103 option=-103 name=--reread arg=(null) num=1
3482return=-103 option=-103 name=--reread arg=2 num=2'
3483
3484TEST 55 'solaris old format long option name compatibility'
3485	usage=$'f:(file)(input-file)g(global)o:(output)(output-file)'
3486	EXEC oksh "$usage" --usage
3487		OUTPUT - $'return=? option=- name=--usage num=0'
3488		ERROR - $'[-][f:file|input-file]:[string][g:global][o:output|output-file]:[string]'
3489		EXIT 2
3490	EXEC oksh "$usage" -f in -g -o out
3491		OUTPUT - $'return=f option=-f name=-f arg=in num=1
3492return=g option=-g name=-g arg=(null) num=1
3493return=o option=-o name=-o arg=out num=1'
3494		ERROR -
3495		EXIT 0
3496	EXEC oksh "$usage" --file=in --glob --out=out
3497		OUTPUT - $'return=f option=-f name=--file arg=in num=1
3498return=g option=-g name=--global arg=(null) num=1
3499return=o option=-o name=--output arg=out num=1'
3500	usage=$'xf:(file)(input-file)g(global)o:(output)(output-file)'
3501	EXEC oksh "$usage" --usage
3502		OUTPUT - $'return=? option=- name=--usage num=0'
3503		ERROR - $'[-][x][f:file|input-file]:[string][g:global][o:output|output-file]:[string]'
3504		EXIT 2
3505	usage=$'x:f:(file)(input-file)g(global)o:(output)(output-file)'
3506	EXEC oksh "$usage" --usage
3507		ERROR - $'[-][x]:[string][f:file|input-file]:[string][g:global][o:output|output-file]:[string]'
3508	usage=$'f:(file)(input-file)g(global)xo:(output)(output-file)'
3509	EXEC oksh "$usage" --usage
3510		ERROR - $'[-][f:file|input-file]:[string][g:global][x][o:output|output-file]:[string]'
3511	usage=$'f:(file)(input-file)g(global)x:o:(output)(output-file)'
3512	EXEC oksh "$usage" --usage
3513		ERROR - $'[-][f:file|input-file]:[string][g:global][x]:[string][o:output|output-file]:[string]'
3514
3515TEST 56 'old format does long options, well, with a lot of secondary work'
3516	usage=$'o:-:'
3517	EXEC oldisnew "$usage" -o old --boolean --name=value
3518		OUTPUT - $'return=o option=-o name=-o arg=old num=1
3519return=- option=-- name=-- arg=boolean num=1
3520return=- option=-- name=-- arg=name=value num=1'
3521	EXEC oldisnew "$usage" '--?'
3522		OUTPUT - $'return=? option=-? name=--? num=0'
3523		ERROR - $'Usage: oldisnew [-o arg] [--long-option[=value]]'
3524		EXIT 2
3525
3526TEST 57 'and the new format does old options'
3527	usage=$'[-][f:FFF][n:NNN]#[nnn][s:SSS]:[sss]\n\nfile ...'
3528	EXEC newisold "$usage" --'??posix'
3529		OUTPUT - $'return=? option=-? name=--??posix num=0'
3530		ERROR - $'fn:s:'
3531		EXIT 2
3532
3533TEST 58 'various --* combinations'
3534	usage=$'[-][f:format]:[format]'
3535	EXEC printf "$usage" - operand
3536		OUTPUT - $'argument=1 value="-"\nargument=2 value="operand"'
3537	EXEC printf "$usage" -- operand
3538		OUTPUT - $'argument=1 value="operand"'
3539	EXEC printf "$usage" -- --operand
3540		OUTPUT - $'argument=1 value="--operand"'
3541	EXEC printf "$usage" -- ---operand
3542		OUTPUT - $'argument=1 value="---operand"'
3543	EXEC printf "$usage" ---operand
3544		OUTPUT - $'argument=1 value="---operand"'
3545	EXEC
3546
3547TEST 59 'optget options'
3548	usage=$'[-n?\n@(#)$Id: sort (AT&T Research) 2008-04-24 $\n]'
3549	EXEC sort "$usage" --man
3550		OUTPUT - $'return=? option=- name=--man num=0'
3551		ERROR - $'SYNOPSIS
3552  sort [ options ]
3553
3554IMPLEMENTATION
3555  version         sort (AT&T Research) 2008-04-24'
3556		EXIT 2
3557
3558TEST 60 'about nested components'
3559
3560	usage=$'[-][+NAME?boohoo][m:method?The methods are:]{[+hal?HAL]{[--hoo?HOO][-har?HAR][--huh?HUH]}[+bob?BOB]{[--boo?BOO][-bar?BAR][--buh?BUH]}}'
3561	EXEC sort "$usage" --man
3562		OUTPUT - $'return=? option=- name=--man num=0'
3563		ERROR - $'NAME
3564  boohoo
3565
3566SYNOPSIS
3567  boohoo [ options ]
3568
3569OPTIONS
3570  -m, --method    The methods are:
3571                    hal   HAL
3572                            (har)           HAR
3573                            (huh)           HUH
3574                    bob   BOB
3575                            (bar)           BAR
3576                            (buh)           BUH'
3577		EXIT 2
3578
3579	usage=$'[-][+NAME?boohoo][m:method?The methods are:]{[+hal?HAL]{[--hoo?HOO][-har?HAR]}[+bob?BOB]{[--boo?BOO][-bar?BAR]}}'
3580	EXEC sort "$usage" --man
3581		OUTPUT - $'return=? option=- name=--man num=0'
3582		ERROR - $'NAME
3583  boohoo
3584
3585SYNOPSIS
3586  boohoo [ options ]
3587
3588OPTIONS
3589  -m, --method    The methods are:
3590                    hal   HAL
3591                            (har)           HAR
3592                    bob   BOB
3593                            (bar)           BAR'
3594
3595	usage=$'[-][+NAME?boohoo][m:method?The methods are:]{[+hal?HAL]{[+hoo?HOO][-har?HAR]}[+bob?BOB]{[-boo?BOO][+bar?BAR]}}'
3596	EXEC sort "$usage" --man
3597		OUTPUT - $'return=? option=- name=--man num=0'
3598		ERROR - $'NAME
3599  boohoo
3600
3601SYNOPSIS
3602  boohoo [ options ]
3603
3604OPTIONS
3605  -m, --method    The methods are:
3606                    hal   HAL
3607                            hoo   HOO
3608                            (har)           HAR
3609                    bob   BOB
3610                            (boo)           BOO
3611                            bar             BAR'
3612
3613	usage=$'[-][+NAME?boohoo][m:method?The methods are:]{[+hal?HAL]{[--hoo?HOO][-har?HAR][--huh?HUH]}[+bob?BOB]{[--boo?BOO][-bar?BAR][--buh?BUH]}}'
3614	EXEC sort "$usage" --man
3615		OUTPUT - $'return=? option=- name=--man num=0'
3616		ERROR - $'NAME
3617  boohoo
3618
3619SYNOPSIS
3620  boohoo [ options ]
3621
3622OPTIONS
3623  -m, --method    The methods are:
3624                    hal   HAL
3625                            (har)           HAR
3626                            (huh)           HUH
3627                    bob   BOB
3628                            (bar)           BAR
3629                            (buh)           BUH'
3630
3631	info=$'[+hal?HAL]{[--hoo?HOO][-har?HAR][--huh?HUH]}[+bob?BOB]{[--boo?BOO][-bar?BAR][--buh?BUH]}'
3632	usage=$'[-][+NAME?boohoo][m:method?The methods are:]{\fTEST\f}'
3633	EXEC =TEST="$info" sort "$usage" --man
3634
3635	info=$'[+hal?HAL]{[+hoo?HOO][-?\n@(#)$Id: zip::hoo (AT&T Research) 2003-01-01 $\n][-har?HAR][--xxx?yyy][--catalog?zip][+aha?AHA]}[+bob?BOB]{[-?\n@(#)$Id: zip::boo (AT&T Research) 2003-01-01 $\n][-bar?BAR]}'
3636	usage=$'[-][+NAME?boohoo][m:method?The methods are:]{\fTEST\f}'
3637	EXEC =TEST="$info" sort "$usage" --man
3638		ERROR - $'NAME
3639  boohoo
3640
3641SYNOPSIS
3642  boohoo [ options ]
3643
3644OPTIONS
3645  -m, --method    The methods are:
3646                    hal   HAL
3647                            hoo   HOO
3648                            (version)       zip::hoo (AT&T Research) 2003-01-01
3649                            (har)           HAR
3650                            (xxx)           yyy
3651                            (catalog)       zip
3652                            aha             AHA
3653                    bob   BOB
3654                            (version)       zip::boo (AT&T Research) 2003-01-01
3655                            (bar)           BAR'
3656
3657	EXEC =TEST="$info" sort "$usage" --help
3658		OUTPUT - $'return=? option=- name=--help num=0'
3659		ERROR - $'Usage: sort [ options ]
3660OPTIONS
3661  -m, --method    The methods are:
3662                    hal   HAL
3663                            hoo   HOO
3664                            aha   AHA
3665                    bob   BOB'
3666
3667	EXEC =TEST="$info" sort "$usage" --?method
3668		OUTPUT - $'return=? option=-? name=--?method num=0'
3669		ERROR - $'Usage: sort [ options ]
3670OPTIONS
3671  -m, --method    The methods are:
3672                    hal   HAL
3673                            hoo   HOO
3674                            aha   AHA
3675                    bob   BOB'
3676
3677	usage=$'
3678[-?\n@(#)$Id: codex (AT&T Research) 2009-04-15 $\n]
3679[+NAME?codex - encode/decode filter]
3680[+?The supported methods are:]
3681    {
3682        [+zip\b?zip compression. The first parameter is the PKZIP
3683            compression method.]
3684            {
3685                [+copy|0?No compression.]
3686                [+shrink|1?Shrink compression.]
3687                [+reduce|2|3|4|5?Reduce compression.]
3688                [+implode|6?Implode compression.]
3689                [+deflate|8?Deflate compression.]
3690            }
3691    }
3692[d:decode?Apply the \amethod\a operand to the standard input only.]
3693[e:encode?Apply the \amethod\a operand to the standard output only.]
3694
3695file ...
3696
3697[+SEE ALSO?\bcodex\b(3), \bvcodex\b(3)]'
3698	EXEC codex "$usage" --man
3699		OUTPUT - $'return=? option=- name=--man num=0'
3700		ERROR - $'NAME
3701  codex - encode/decode filter
3702
3703SYNOPSIS
3704  codex [ options ] file ...
3705
3706  The supported methods are:
3707    zip   zip compression. The first parameter is the PKZIP compression method.
3708            copy|0
3709                  No compression.
3710            shrink|1
3711                  Shrink compression.
3712            reduce|2|3|4|5
3713                  Reduce compression.
3714            implode|6
3715                  Implode compression.
3716            deflate|8
3717                  Deflate compression.
3718
3719OPTIONS
3720  -d, --decode    Apply the method operand to the standard input only.
3721  -e, --encode    Apply the method operand to the standard output only.
3722
3723SEE ALSO
3724  codex(3), vcodex(3)
3725
3726IMPLEMENTATION
3727  version         codex (AT&T Research) 2009-04-15'
3728
3729TEST 61 'man(1) section titles'
3730
3731	usage=$'[-1s1M][+NAME?section]'
3732	EXEC section "$usage" '--???MAN'
3733		OUTPUT - 'return=? option=-? name=--???MAN num=0'
3734		ERROR - 'MAKE ASSERTION OPERATORS AND RULES'
3735		EXIT 2
3736	EXEC section "$usage" '--???MAN=5P'
3737		OUTPUT - 'return=? option=-? name=--???MAN num=0'
3738		ERROR - 'PLUGINS'
3739	EXEC section "$usage" '--???MAN=5PU'
3740		OUTPUT - 'return=? option=-? name=--???MAN num=0'
3741		ERROR - 'UWIN PLUGINS'
3742	EXEC section "$usage" '--???MAN=8U'
3743		OUTPUT - 'return=? option=-? name=--???MAN num=0'
3744		ERROR - 'UWIN ADMINISTRATIVE COMMANDS'
3745
3746TEST 62 'conformance conditionals'
3747
3748	usage=$'[-][a:all?ALL][(foo|ast)s:some?SOME][(foo|bar)n:never?NEVER][e:every?EVERY][(foo|bar)+?Specific text.]'
3749	EXEC conformance "$usage" -a
3750		OUTPUT - 'return=a option=-a name=-a arg=(null) num=1'
3751	EXEC conformance "$usage" --all
3752		OUTPUT - 'return=a option=-a name=--all arg=(null) num=1'
3753	EXEC conformance "$usage" -s
3754		OUTPUT - 'return=s option=-s name=-s arg=(null) num=1'
3755	EXEC conformance "$usage" --some
3756		OUTPUT - 'return=s option=-s name=--some arg=(null) num=1'
3757	EXEC conformance "$usage" -e
3758		OUTPUT - 'return=e option=-e name=-e arg=(null) num=1'
3759	EXEC conformance "$usage" --every
3760		OUTPUT - 'return=e option=-e name=--every arg=(null) num=1'
3761	EXEC conformance "$usage" -n
3762		EXIT 1
3763		OUTPUT - 'return=: option= name=-n num=0 str=[-][a:all?ALL][(foo|ast)s:some?SOME][(foo|bar)n:never?NEVER][e:every?EVERY][(foo|bar)+?Specific text.]'
3764		ERROR - $'conformance: -n: unknown option'
3765	EXEC conformance "$usage" --never
3766		OUTPUT - 'return=: option= name=--never num=0 str=--never'
3767		ERROR - 'conformance: --never: unknown option'
3768	EXEC conformance "$usage" --man
3769		EXIT 2
3770		OUTPUT - $'return=? option=- name=--man num=0'
3771		ERROR - $'OPTIONS
3772  -a, --all       ALL
3773  -s, --some      [(foo|ast) conformance] SOME
3774  -n, --never     [(foo|bar) conformance] NEVER
3775  -e, --every     EVERY
3776
3777  [(foo|bar) conformance] Specific text.
3778
3779SYNOPSIS
3780  conformance [ options ]'
3781
3782	EXEC conformance "$usage" --html
3783		OUTPUT - $'return=? option=- name=--html num=0'
3784		ERROR - '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
3785<HTML>
3786<HEAD>
3787<META name="generator" content="optget (AT&T Research) 2011-11-11">
3788<TITLE>conformance man document</TITLE>
3789<STYLE type="text/css">
3790div.SH { padding-left:2em; text-indent:0em; }
3791div.SY { padding-left:4em; text-indent:-2em; }
3792dt { float:left; clear:both; }
3793dd { margin-left:3em; }
3794</STYLE>
3795</HEAD>
3796<BODY bgcolor=white>
3797<H4><TABLE width=100%><TR><TH align=left>CONFORMANCE&nbsp;(&nbsp;1&nbsp;)&nbsp;<TH align=center><A href="." title="Index">USER COMMANDS</A><TH align=right>CONFORMANCE&nbsp;(&nbsp;1&nbsp;)</TR></TABLE></H4>
3798<HR>
3799<H4><A name="OPTIONS">OPTIONS</A></H4>
3800<DIV class=SH>
3801<DL>
3802<DT>-<B>a</B>, --<B>all</B><DD><BR>ALL
3803<DT>-<B>s</B>, --<B>some</B><DD><BR>&#0091;(foo|ast) conformance&#0093; SOME
3804<DT>-<B>n</B>, --<B>never</B><DD><BR>&#0091;(foo|bar) conformance&#0093; NEVER
3805<DT>-<B>e</B>, --<B>every</B><DD><BR>EVERY
3806<P>
3807<DT>&#0091;(foo|bar) conformance&#0093; Specific text.
3808<P>
3809</DL>
3810</DIV>
3811<H4><A name="SYNOPSIS">SYNOPSIS</A></H4>
3812<DIV class=SY>
3813<B>conformance</B> &#0091; <I>options</I> &#0093;
3814</DIV>
3815</BODY>
3816</HTML>'
3817
3818# skip non-astsa (standalone ast) tests
3819
3820[[ $($COMMAND -+ astsa '[-]' '--???about' 2>/dev/null) == *catalog=libast* ]] || exit
3821
3822TEST 98 'translation'
3823	usage=$'[-][+NAME?aha - just do it][+DESCRIPTION?Bla bla.]{\fzero\f}\n\n[ dialect ]\n\n[+SEE ALSO?Bla.]'
3824	EXEC -+ aha "$usage" --man
3825		OUTPUT - $'id=aha catalog=libast text="about"
3826id=aha catalog=libast text="api"
3827id=aha catalog=libast text="help"
3828id=aha catalog=libast text="html"
3829id=aha catalog=libast text="keys"
3830id=aha catalog=libast text="long"
3831id=aha catalog=libast text="man"
3832id=aha catalog=libast text="about"
3833id=aha catalog=libast text="api"
3834id=aha catalog=libast text="help"
3835id=aha catalog=libast text="html"
3836id=aha catalog=libast text="keys"
3837id=aha catalog=libast text="long"
3838id=aha catalog=libast text="man"
3839id=aha catalog=libast text="NAME"
3840id=aha catalog=libast text="aha - just do it"
3841id=aha catalog=libast text="DESCRIPTION"
3842id=aha catalog=libast text="Bla bla."
3843id=aha catalog=libast text="dabba"
3844id=aha catalog=libast text="aroni"
3845id=aha catalog=libast text="SEE ALSO"
3846id=aha catalog=libast text="Bla."
3847id=aha catalog=libast text="SYNOPSIS"
3848id=aha catalog=libast text="options"
3849id=aha catalog=libast text="[ dialect ]"
3850return=? option=- name=--man num=0
3851id=aha catalog=libast text="Usage"'
3852		ERROR - $'ANZR
3853  nun - whfg qb vg
3854
3855FLABCFVF
3856  aha [ bcgvbaf ] [ qvnyrpg ]
3857
3858QRFPEVCGVBA
3859  Oyn oyn.
3860    yabba qnoon
3861    doo   nebav
3862
3863FRR NYFB
3864  Oyn.'
3865		EXIT 2
3866	usage=$getopts_usage
3867	EXEC	-+ getopts "$usage" '--man'
3868		OUTPUT - $'id=getopts catalog=libast text="command"
3869id=getopts catalog=libast text="about"
3870id=getopts catalog=libast text="api"
3871id=getopts catalog=libast text="help"
3872id=getopts catalog=libast text="html"
3873id=getopts catalog=libast text="keys"
3874id=getopts catalog=libast text="long"
3875id=getopts catalog=libast text="man"
3876id=getopts catalog=libast text="about"
3877id=getopts catalog=libast text="api"
3878id=getopts catalog=libast text="help"
3879id=getopts catalog=libast text="html"
3880id=getopts catalog=libast text="keys"
3881id=getopts catalog=libast text="long"
3882id=getopts catalog=libast text="man"
3883id=getopts catalog=libast text="version"
3884id=getopts catalog=libast text="getopts (AT&T Research) 1999-02-02
3885"
3886id=getopts catalog=libast text="NAME"
3887id=getopts catalog=libast text="? - parse utility options"
3888id=getopts catalog=libast text="OPTIONS"
3889id=getopts catalog=libast text="command"
3890id=getopts catalog=libast text="name"
3891id=getopts catalog=libast text="Use \aname\a instead of the command name in usage messages."
3892id=getopts catalog=libast text="DESCRIPTION"
3893id=getopts catalog=libast text="The \bgetopts\b utility can be used to retrieve options and
3894arguments from a list of arguments give by \aargs\a or the positional
3895parameters if \aargs\a is omitted.  It can also generate usage messages
3896and a man page for the command based on the information in \aoptstring\a."
3897id=getopts catalog=libast text="The \aoptstring\a string consists of alpha-numeric characters,
3898the special characters +, -, ?, :, and <space>, or character groups
3899enclosed in [...].  Character groups may be nested in {...}.
3900Outside of a [...] group, a single new-line followed by zero or
3901more blanks is ignored.  One or more blank lines separates the
3902options from the command argument synopsis."
3903id=getopts catalog=libast text="Each [...] group consists of an optional label,
3904optional attributes separated by :, and an
3905optional description string following ?.  The characters from the ?
3906to the end of the next ] are ignored for option parsing and short
3907usage messages.  They are used for generating verbose help or man pages.
3908The : character may not appear in the label.
3909The ? character must be specified as ?? in label and the ] character
3910must be specified as ]] in the description string.
3911Text between two \\b (backspace) characters indicates
3912that the text should be emboldened when displayed.
3913Text between two \\a (bell) characters indicates that the text should
3914be emphasised or italicised when displayed."
3915id=getopts catalog=libast text="There are four types of groups:"
3916id=getopts catalog=libast text="An option specifiation of the form \aoption\a:\alongname\a.
3917	In this case the first field is the option character.  If there
3918	is no option character, then a two digit number should be specified
3919	that corresponds to the long options.  This negative of this number
3920	will be returned as the value of \aname\a by \bgetopts\b if the long
3921	option is matched. A longname is matched with \b--\b\alongname\a.  A
3922	* in the \alongname\a field indicates that only characters up that
3923	point need to match provided any additional characters match the option.
3924	The [ and ] can be omitted for options that don\'t have longnames
3925	or descriptive text."
3926id=getopts catalog=libast text="A string option argument specification.
3927	Options that take arguments can be followed by : or # and an option
3928	group specification.  An option group specification consists
3929	of a name for the option argument as field 1.   The remaining
3930	fields are a typename and zero or more of the special attribute words
3931	\blistof\b, \boneof\b, and \bignorecase\b.
3932	The option specification can be followed
3933	by a list of option value descriptions enclosed in parenthesis."
3934id=getopts catalog=libast text="A option value description."
3935id=getopts catalog=libast text="A argument specification. A list of valid option argument values
3936		can be specified by enclosing them inside a {...} following
3937		the option argument specification.  Each of the permitted
3938		values can be specified with a [...] containing the
3939		value followed by a description."
3940id=getopts catalog=libast text="If the leading character of \aoptstring\a is +, then arguments
3941beginning with + will also be considered options."
3942id=getopts catalog=libast text="A leading : character or a : following a leading + in \aoptstring\a
3943affects the way errors are handled.  If an option character or longname
3944argument not specified in \aoptstring\a is encountered when processing
3945options, the shell variable whose name is \aname\a will be set to the ?
3946character.  The shell variable \bOPTARG\b will be set to
3947the character found.  If an option argument is missing or has an invalid
3948value, then \aname\a will be set to the : character and the shell variable
3949\bOPTARG\b will be set to the option character found.
3950Without the leading :, \aname\a will be set to the ? character, \bOPTARG\b
3951will be unset, and an error message will be written to standard error
3952when errors are encountered."
3953id=getopts catalog=libast text="The end of options occurs when:"
3954id=getopts catalog=libast text="The special argument \b--\b."
3955id=getopts catalog=libast text="An argument that does not beging with a \b-\b."
3956id=getopts catalog=libast text="A help argument is specified."
3957id=getopts catalog=libast text="An error is encountered."
3958id=getopts catalog=libast text="If \bOPTARG\b is set to the value \b1\b, a new set of arguments
3959can be used."
3960id=getopts catalog=libast text="\bgetopts\b can also be used to generate help messages containing command
3961usage and detailed descriptions.  Specify \aargs\a as:"
3962id=getopts catalog=libast text="To generate a usage synopsis."
3963id=getopts catalog=libast text="To generate a verbose usage message."
3964id=getopts catalog=libast text="To generate a formatted man page."
3965id=getopts catalog=libast text="To generate an easy to parse usage message."
3966id=getopts catalog=libast text="To generate a man page in \bhtml\b format."
3967id=getopts catalog=libast text="When the end of options is encountered, \bgetopts\b exits with a
3968non-zero return value and the variable \bOPTIND\b is set to the
3969index of the first non-option argument."
3970id=getopts catalog=libast text="EXIT STATUS"
3971id=getopts catalog=libast text="An option specified was found."
3972id=getopts catalog=libast text="An end of options was encountered."
3973id=getopts catalog=libast text="A usage or information message was generated."
3974id=getopts catalog=libast text="IMPLEMENTATION"
3975id=getopts catalog=libast text="SYNOPSIS"
3976id=getopts catalog=libast text="options"
3977id=getopts catalog=libast text="opstring name [args...]"
3978return=? option=- name=--man num=0
3979id=getopts catalog=libast text="Usage"'
3980		ERROR - $'ANZR
3981  getopts - cnefr hgvyvgl bcgvbaf
3982
3983FLABCFVF
3984  getopts [ bcgvbaf ] bcfgevat anzr [netf...]
3985
3986BCGVBAF
3987  -a, --pbzznaq|command=anzr
3988                  Hfr anzr vafgrnq bs gur pbzznaq anzr va hfntr zrffntrf.
3989
3990QRFPEVCGVBA
3991  Gur getopts hgvyvgl pna or hfrq gb ergevrir bcgvbaf naq nethzragf sebz n yvfg
3992  bs nethzragf tvir ol netf be gur cbfvgvbany cnenzrgref vs netf vf bzvggrq. Vg
3993  pna nyfb trarengr hfntr zrffntrf naq n zna cntr sbe gur pbzznaq onfrq ba gur
3994  vasbezngvba va bcgfgevat.
3995
3996  Gur bcgfgevat fgevat pbafvfgf bs nycun-ahzrevp punenpgref, gur fcrpvny
3997  punenpgref +, -, ?, :, naq <fcnpr>, be punenpgre tebhcf rapybfrq va [...].
3998  Punenpgre tebhcf znl or arfgrq va {...}. Bhgfvqr bs n [...] tebhc, n fvatyr
3999  arj-yvar sbyybjrq ol mreb be zber oynaxf vf vtaberq. Bar be zber oynax yvarf
4000  frcnengrf gur bcgvbaf sebz gur pbzznaq nethzrag flabcfvf.
4001
4002  Rnpu [...] tebhc pbafvfgf bs na bcgvbany ynory, bcgvbany nggevohgrf frcnengrq
4003  ol :, naq na bcgvbany qrfpevcgvba fgevat sbyybjvat ?. Gur punenpgref sebz gur
4004  ? gb gur raq bs gur arkg ] ner vtaberq sbe bcgvba cnefvat naq fubeg hfntr
4005  zrffntrf. Gurl ner hfrq sbe trarengvat ireobfr uryc be zna cntrf. Gur :
4006  punenpgre znl abg nccrne va gur ynory. Gur ? punenpgre zhfg or fcrpvsvrq nf
4007  ?? va ynory naq gur ] punenpgre zhfg or fcrpvsvrq nf ]] va gur qrfpevcgvba
4008  fgevat. Grkg orgjrra gjb \\b (onpxfcnpr) punenpgref vaqvpngrf gung gur grkg
4009  fubhyq or rzobyqrarq jura qvfcynlrq. Grkg orgjrra gjb \\a (oryy) punenpgref
4010  vaqvpngrf gung gur grkg fubhyq or rzcunfvfrq be vgnyvpvfrq jura qvfcynlrq.
4011
4012  Gurer ner sbhe glcrf bs tebhcf:
4013    1.    Na bcgvba fcrpvsvngvba bs gur sbez bcgvba:ybatanzr. Va guvf pnfr gur
4014          svefg svryq vf gur bcgvba punenpgre. Vs gurer vf ab bcgvba punenpgre,
4015          gura n gjb qvtvg ahzore fubhyq or fcrpvsvrq gung pbeerfcbaqf gb gur
4016          ybat bcgvbaf. Guvf artngvir bs guvf ahzore jvyy or erghearq nf gur
4017          inyhr bs anzr ol getopts vs gur ybat bcgvba vf zngpurq. N ybatanzr vf
4018          zngpurq jvgu --ybatanzr. N * va gur ybatanzr svryq vaqvpngrf gung
4019          bayl punenpgref hc gung cbvag arrq gb zngpu cebivqrq nal nqqvgvbany
4020          punenpgref zngpu gur bcgvba. Gur [ naq ] pna or bzvggrq sbe bcgvbaf
4021          gung qba\'g unir ybatanzrf be qrfpevcgvir grkg.
4022    2.    N fgevat bcgvba nethzrag fcrpvsvpngvba. Bcgvbaf gung gnxr nethzragf
4023          pna or sbyybjrq ol : be # naq na bcgvba tebhc fcrpvsvpngvba. Na
4024          bcgvba tebhc fcrpvsvpngvba pbafvfgf bs n anzr sbe gur bcgvba nethzrag
4025          nf svryq 1. Gur erznvavat svryqf ner n glcranzr naq mreb be zber bs
4026          gur fcrpvny nggevohgr jbeqf listof, oneof, naq ignorecase. Gur bcgvba
4027          fcrpvsvpngvba pna or sbyybjrq ol n yvfg bs bcgvba inyhr qrfpevcgvbaf
4028          rapybfrq va cneragurfvf.
4029    3.    N bcgvba inyhr qrfpevcgvba.
4030    4.    N nethzrag fcrpvsvpngvba. N yvfg bs inyvq bcgvba nethzrag inyhrf pna
4031          or fcrpvsvrq ol rapybfvat gurz vafvqr n {...} sbyybjvat gur bcgvba
4032          nethzrag fcrpvsvpngvba. Rnpu bs gur crezvggrq inyhrf pna or fcrpvsvrq
4033          jvgu n [...] pbagnvavat gur inyhr sbyybjrq ol n qrfpevcgvba.
4034
4035  Vs gur yrnqvat punenpgre bs bcgfgevat vf +, gura nethzragf ortvaavat jvgu +
4036  jvyy nyfb or pbafvqrerq bcgvbaf.
4037
4038  N yrnqvat : punenpgre be n : sbyybjvat n yrnqvat + va bcgfgevat nssrpgf gur
4039  jnl reebef ner unaqyrq. Vs na bcgvba punenpgre be ybatanzr nethzrag abg
4040  fcrpvsvrq va bcgfgevat vf rapbhagrerq jura cebprffvat bcgvbaf, gur furyy
4041  inevnoyr jubfr anzr vf anzr jvyy or frg gb gur ? punenpgre. Gur furyy
4042  inevnoyr OPTARG jvyy or frg gb gur punenpgre sbhaq. Vs na bcgvba nethzrag vf
4043  zvffvat be unf na vainyvq inyhr, gura anzr jvyy or frg gb gur : punenpgre naq
4044  gur furyy inevnoyr OPTARG jvyy or frg gb gur bcgvba punenpgre sbhaq. Jvgubhg
4045  gur yrnqvat :, anzr jvyy or frg gb gur ? punenpgre, OPTARG jvyy or hafrg, naq
4046  na reebe zrffntr jvyy or jevggra gb fgnaqneq reebe jura reebef ner
4047  rapbhagrerq.
4048
4049  Gur raq bs bcgvbaf bpphef jura:
4050    1.    Gur fcrpvny nethzrag --.
4051    2.    Na nethzrag gung qbrf abg ortvat jvgu n -.
4052    3.    N uryc nethzrag vf fcrpvsvrq.
4053    4.    Na reebe vf rapbhagrerq.
4054
4055  Vs OPTARG vf frg gb gur inyhr 1, n arj frg bs nethzragf pna or hfrq.
4056
4057  getopts pna nyfb or hfrq gb trarengr uryc zrffntrf pbagnvavat pbzznaq hfntr
4058  naq qrgnvyrq qrfpevcgvbaf. Fcrpvsl netf nf:
4059    -?    Gb trarengr n hfntr flabcfvf.
4060    --??  Gb trarengr n ireobfr hfntr zrffntr.
4061    --??man
4062          Gb trarengr n sbeznggrq zna cntr.
4063    --??api
4064          Gb trarengr na rnfl gb cnefr hfntr zrffntr.
4065    --??html
4066          Gb trarengr n zna cntr va html sbezng.
4067
4068  Jura gur raq bs bcgvbaf vf rapbhagrerq, getopts rkvgf jvgu n aba-mreb erghea
4069  inyhr naq gur inevnoyr OPTIND vf frg gb gur vaqrk bs gur svefg aba-bcgvba
4070  nethzrag.
4071
4072RKVG FGNGHF
4073    0     Na bcgvba fcrpvsvrq jnf sbhaq.
4074    1     Na raq bs bcgvbaf jnf rapbhagrerq.
4075    2     N hfntr be vasbezngvba zrffntr jnf trarengrq.
4076
4077VZCYRZRAGNGVBA
4078  irefvba         trgbcgf (NG&G Erfrnepu) 1999-02-02'
4079	usage=$'[-?\n@(#)xlate 1.0\n][-author?Col. Hyde][a:algorithm]:[method][b:again|back]'
4080	EXEC -+ xlate "$usage" --algorithm=xxx --again --back
4081		OUTPUT - $'id=xlate catalog=libast text="algorithm"
4082return=a option=-a name=--algorithm arg=xxx num=1
4083id=xlate catalog=libast text="algorithm"
4084id=xlate catalog=libast text="again|back"
4085return=b option=-b name=--again arg=(null) num=1
4086id=xlate catalog=libast text="algorithm"
4087id=xlate catalog=libast text="again|back"
4088return=b option=-b name=--back arg=(null) num=1'
4089		ERROR -
4090		EXIT 0
4091	EXEC -+ xlate "$usage" --nytbevguz=xxx --ntnva --onpx
4092		OUTPUT - $'id=xlate catalog=libast text="algorithm"
4093return=a option=-a name=--nytbevguz arg=xxx num=1
4094id=xlate catalog=libast text="algorithm"
4095id=xlate catalog=libast text="again|back"
4096return=b option=-b name=--ntnva arg=(null) num=1
4097id=xlate catalog=libast text="algorithm"
4098id=xlate catalog=libast text="again|back"
4099return=b option=-b name=--onpx arg=(null) num=1'
4100	EXEC -+ xlate "$usage" --algorithm
4101		EXIT 1
4102		OUTPUT - $'id=xlate catalog=libast text="algorithm"
4103id=xlate catalog=libast text="method"
4104id=xlate catalog=libast text="value expected"
4105return=: option=-a name=--algorithm num=0
4106id=xlate catalog=libast text="%s"'
4107		ERROR - $'xlate: --algorithm: zrgubq inyhr rkcrpgrq'
4108	EXEC -+ xlate "$usage" --nytbevguz
4109		OUTPUT - $'id=xlate catalog=libast text="algorithm"
4110id=xlate catalog=libast text="method"
4111id=xlate catalog=libast text="value expected"
4112return=: option=-a name=--nytbevguz num=0
4113id=xlate catalog=libast text="%s"'
4114		ERROR - $'xlate: --nytbevguz: zrgubq inyhr rkcrpgrq'
4115	EXEC -+ xlate "$usage" --man
4116		EXIT 2
4117		OUTPUT - $'id=xlate catalog=libast text="algorithm"
4118id=xlate catalog=libast text="again|back"
4119id=xlate catalog=libast text="about"
4120id=xlate catalog=libast text="api"
4121id=xlate catalog=libast text="help"
4122id=xlate catalog=libast text="html"
4123id=xlate catalog=libast text="keys"
4124id=xlate catalog=libast text="long"
4125id=xlate catalog=libast text="man"
4126id=xlate catalog=libast text="about"
4127id=xlate catalog=libast text="api"
4128id=xlate catalog=libast text="help"
4129id=xlate catalog=libast text="html"
4130id=xlate catalog=libast text="keys"
4131id=xlate catalog=libast text="long"
4132id=xlate catalog=libast text="man"
4133id=xlate catalog=libast text="version"
4134id=xlate catalog=libast text="xlate 1.0
4135"
4136id=xlate catalog=libast text="author"
4137id=xlate catalog=libast text="Col. Hyde"
4138id=xlate catalog=libast text="OPTIONS"
4139id=xlate catalog=libast text="algorithm"
4140id=xlate catalog=libast text="method"
4141id=xlate catalog=libast text="again|back"
4142id=xlate catalog=libast text="IMPLEMENTATION"
4143id=xlate catalog=libast text="SYNOPSIS"
4144id=xlate catalog=libast text="options"
4145return=? option=- name=--man num=0
4146id=xlate catalog=libast text="Usage"'
4147		ERROR - $'FLABCFVF
4148  xlate [ bcgvbaf ]
4149
4150BCGVBAF
4151  -a, --nytbevguz|algorithm=zrgubq
4152  -b, --ntnva|onpx|again|back
4153
4154VZCYRZRAGNGVBA
4155  irefvba         kyngr 1.0
4156  nhgube          Pby. Ulqr'
4157	EXEC -+ xlate "$usage" -?
4158		OUTPUT - $'id=xlate catalog=libast text="method"
4159id=xlate catalog=libast text="options"
4160return=? option=-? name=-? num=0
4161id=xlate catalog=libast text="Usage"'
4162		ERROR - $'Hfntr: xlate [-b] [-a zrgubq]'
4163	EXEC -+ xlate "$usage" --?
4164		OUTPUT - $'id=xlate catalog=libast text="OPTIONS"
4165id=xlate catalog=libast text="algorithm"
4166id=xlate catalog=libast text="method"
4167id=xlate catalog=libast text="again|back"
4168id=xlate catalog=libast text="options"
4169return=? option=-? name=--? num=0
4170id=xlate catalog=libast text="Usage"'
4171		ERROR - $'Hfntr: xlate [ bcgvbaf ]
4172BCGVBAF
4173  -a, --nytbevguz|algorithm=zrgubq
4174  -b, --ntnva|onpx|again|back'
4175	EXEC -+ xlate "$usage" --??
4176		OUTPUT - $'id=xlate catalog=libast text="version"
4177id=xlate catalog=libast text="xlate 1.0
4178"
4179id=xlate catalog=libast text="author"
4180id=xlate catalog=libast text="Col. Hyde"
4181id=xlate catalog=libast text="OPTIONS"
4182id=xlate catalog=libast text="algorithm"
4183id=xlate catalog=libast text="method"
4184id=xlate catalog=libast text="again|back"
4185id=xlate catalog=libast text="IMPLEMENTATION"
4186id=xlate catalog=libast text="SYNOPSIS"
4187id=xlate catalog=libast text="options"
4188return=? option=-? name=--?? num=0
4189id=xlate catalog=libast text="Usage"'
4190		ERROR - $'FLABCFVF
4191  xlate [ bcgvbaf ]
4192
4193BCGVBAF
4194  -a, --nytbevguz|algorithm=zrgubq
4195  -b, --ntnva|onpx|again|back
4196
4197VZCYRZRAGNGVBA
4198  irefvba         kyngr 1.0
4199  nhgube          Pby. Ulqr'
4200	EXEC -+ xlate "$usage" --???
4201		OUTPUT - $'id=xlate catalog=libast text="about"
4202id=xlate catalog=libast text="api"
4203id=xlate catalog=libast text="help"
4204id=xlate catalog=libast text="html"
4205id=xlate catalog=libast text="keys"
4206id=xlate catalog=libast text="long"
4207id=xlate catalog=libast text="man"
4208id=xlate catalog=libast text="nroff"
4209id=xlate catalog=libast text="options"
4210id=xlate catalog=libast text="posix"
4211id=xlate catalog=libast text="short"
4212id=xlate catalog=libast text="usage"
4213id=xlate catalog=libast text="NAME"
4214id=xlate catalog=libast text="options available to all \bast\b commands"
4215id=xlate catalog=libast text="DESCRIPTION"
4216id=xlate catalog=libast text="\b-?\b and \b--?\b* options are the same for all \bast\b commands. For any \aitem\a below, if \b--\b\aitem\a is not supported by a given command then it is equivalent to \b--??\b\aitem\a. The \b--??\b form should be used for portability. All output is written to the standard error."
4217id=xlate catalog=libast text="OPTIONS"
4218id=xlate catalog=libast text="about"
4219id=xlate catalog=libast text="List all implementation info."
4220id=xlate catalog=libast text="api"
4221id=xlate catalog=libast text="List detailed info in program readable form."
4222id=xlate catalog=libast text="help"
4223id=xlate catalog=libast text="List detailed help option info."
4224id=xlate catalog=libast text="html"
4225id=xlate catalog=libast text="List detailed info in html."
4226id=xlate catalog=libast text="keys"
4227id=xlate catalog=libast text="List the usage translation key strings with C style escapes."
4228id=xlate catalog=libast text="long"
4229id=xlate catalog=libast text="List long option usage."
4230id=xlate catalog=libast text="man"
4231id=xlate catalog=libast text="List detailed info in displayed man page form."
4232id=xlate catalog=libast text="nroff"
4233id=xlate catalog=libast text="List detailed info in nroff."
4234id=xlate catalog=libast text="options"
4235id=xlate catalog=libast text="List short and long option details."
4236id=xlate catalog=libast text="posix"
4237id=xlate catalog=libast text="List posix getopt usage."
4238id=xlate catalog=libast text="short"
4239id=xlate catalog=libast text="List short option usage."
4240id=xlate catalog=libast text="usage"
4241id=xlate catalog=libast text="List the usage string with C style escapes."
4242id=xlate catalog=libast text="?-\alabel\a"
4243id=xlate catalog=libast text="List implementation info matching \alabel\a*."
4244id=xlate catalog=libast text="?\aname\a"
4245id=xlate catalog=libast text="Equivalent to \b--help=\b\aname\a."
4246id=xlate catalog=libast text="?"
4247id=xlate catalog=libast text="Equivalent to \b--??options\b."
4248id=xlate catalog=libast text="??"
4249id=xlate catalog=libast text="Equivalent to \b--??man\b."
4250id=xlate catalog=libast text="???"
4251id=xlate catalog=libast text="Equivalent to \b--??help\b."
4252id=xlate catalog=libast text="???\aitem\a"
4253id=xlate catalog=libast text="If the next argument is \b--\b\aoption\a then list the \aoption\a output in the \aitem\a style. Otherwise print \bversion=\b\an\a where \an\a>0 if \b--??\b\aitem\a is supported, \b0\b if not."
4254id=xlate catalog=libast text="???ESC"
4255id=xlate catalog=libast text="Emit escape codes even if output is not a terminal."
4256id=xlate catalog=libast text="???MAN[=\asection\a]"
4257id=xlate catalog=libast text="List the \bman\b(1) section title for \asection\a [the current command]."
4258id=xlate catalog=libast text="???SECTION"
4259id=xlate catalog=libast text="List the \bman\b(1) section number for the current command."
4260id=xlate catalog=libast text="???TEST"
4261id=xlate catalog=libast text="Massage the output for regression testing."
4262id=xlate catalog=libast text="SYNOPSIS"
4263id=xlate catalog=libast text="options"
4264return=? option=-? name=--??? num=0
4265id=xlate catalog=libast text="Usage"'
4266		ERROR - $'ANZR
4267  bcgvbaf ninvynoyr gb nyy ast pbzznaqf
4268
4269FLABCFVF
4270  xlate [ bcgvbaf ]
4271
4272QRFPEVCGVBA
4273  -? naq --?* bcgvbaf ner gur fnzr sbe nyy ast pbzznaqf. Sbe nal vgrz orybj, vs
4274  --vgrz vf abg fhccbegrq ol n tvira pbzznaq gura vg vf rdhvinyrag gb --??vgrz.
4275  Gur --?? sbez fubhyq or hfrq sbe cbegnovyvgl. Nyy bhgchg vf jevggra gb gur
4276  fgnaqneq reebe.
4277
4278BCGVBAF
4279  --nobhg|about   Yvfg nyy vzcyrzragngvba vasb.
4280  --ncv|api       Yvfg qrgnvyrq vasb va cebtenz ernqnoyr sbez.
4281  --uryc|help     Yvfg qrgnvyrq uryc bcgvba vasb.
4282  --ugzy|html     Yvfg qrgnvyrq vasb va ugzy.
4283  --xrlf|keys     Yvfg gur hfntr genafyngvba xrl fgevatf jvgu P fglyr rfpncrf.
4284  --ybat|long     Yvfg ybat bcgvba hfntr.
4285  --zna|man       Yvfg qrgnvyrq vasb va qvfcynlrq zna cntr sbez.
4286  --aebss|nroff   Yvfg qrgnvyrq vasb va aebss.
4287  --bcgvbaf|options
4288                  Yvfg fubeg naq ybat bcgvba qrgnvyf.
4289  --cbfvk|posix   Yvfg cbfvk trgbcg hfntr.
4290  --fubeg|short   Yvfg fubeg bcgvba hfntr.
4291  --hfntr|usage   Yvfg gur hfntr fgevat jvgu P fglyr rfpncrf.
4292  --?-ynory|?-label
4293                  Yvfg vzcyrzragngvba vasb zngpuvat ynory*.
4294  --?anzr|?name   Rdhvinyrag gb --help=anzr.
4295  --?             Rdhvinyrag gb --??options.
4296  --??            Rdhvinyrag gb --??man.
4297  --???           Rdhvinyrag gb --??help.
4298  --???vgrz|???item
4299                  Vs gur arkg nethzrag vf --bcgvba gura yvfg gur bcgvba bhgchg
4300                  va gur vgrz fglyr. Bgurejvfr cevag version=a jurer a>0 vs
4301                  --??vgrz vf fhccbegrq, 0 vs abg.
4302  --???RFP|???ESC Rzvg rfpncr pbqrf rira vs bhgchg vf abg n grezvany.
4303  --???ZNA[=frpgvba]|???MAN[=section]
4304                  Yvfg gur man(1) frpgvba gvgyr sbe frpgvba
4305                  [gur pheerag pbzznaq].
4306  --???FRPGVBA|???SECTION
4307                  Yvfg gur man(1) frpgvba ahzore sbe gur pheerag pbzznaq.
4308  --???GRFG|???TEST
4309                  Znffntr gur bhgchg sbe erterffvba grfgvat.'
4310	EXEC -+ xlate "$usage" --keys
4311		OUTPUT - $'id=xlate catalog=libast text="algorithm"
4312id=xlate catalog=libast text="again|back"
4313id=xlate catalog=libast text="about"
4314id=xlate catalog=libast text="api"
4315id=xlate catalog=libast text="help"
4316id=xlate catalog=libast text="html"
4317id=xlate catalog=libast text="keys"
4318id=xlate catalog=libast text="about"
4319id=xlate catalog=libast text="api"
4320id=xlate catalog=libast text="help"
4321id=xlate catalog=libast text="html"
4322id=xlate catalog=libast text="keys"
4323return=? option=- name=--keys num=0
4324id=xlate catalog=libast text="Usage"'
4325		ERROR - $'"algorithm"
4326"method"
4327"again|back"'
4328	usage=$usage$'[+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}'
4329	EXEC -+ xlate "$usage" --keys
4330		OUTPUT - $'id=xlate catalog=libast text="algorithm"
4331id=xlate catalog=libast text="again|back"
4332id=xlate catalog=libast text="about"
4333id=xlate catalog=libast text="api"
4334id=xlate catalog=libast text="help"
4335id=xlate catalog=libast text="html"
4336id=xlate catalog=libast text="keys"
4337id=xlate catalog=libast text="about"
4338id=xlate catalog=libast text="api"
4339id=xlate catalog=libast text="help"
4340id=xlate catalog=libast text="html"
4341id=xlate catalog=libast text="keys"
4342return=? option=- name=--keys num=0
4343id=xlate catalog=libast text="Usage"'
4344		ERROR - $'"algorithm"
4345"method"
4346"again|back"
4347"Examples."
4348"Foo bar."
4349"\\abar\\a"
4350"Bar foo."
4351"More e.g."
4352"AHA"'
4353	EXEC -+ xlate "$usage" --man
4354		OUTPUT - $'id=xlate catalog=libast text="algorithm"
4355id=xlate catalog=libast text="again|back"
4356id=xlate catalog=libast text="about"
4357id=xlate catalog=libast text="api"
4358id=xlate catalog=libast text="help"
4359id=xlate catalog=libast text="html"
4360id=xlate catalog=libast text="keys"
4361id=xlate catalog=libast text="long"
4362id=xlate catalog=libast text="man"
4363id=xlate catalog=libast text="about"
4364id=xlate catalog=libast text="api"
4365id=xlate catalog=libast text="help"
4366id=xlate catalog=libast text="html"
4367id=xlate catalog=libast text="keys"
4368id=xlate catalog=libast text="long"
4369id=xlate catalog=libast text="man"
4370id=xlate catalog=libast text="version"
4371id=xlate catalog=libast text="xlate 1.0
4372"
4373id=xlate catalog=libast text="author"
4374id=xlate catalog=libast text="Col. Hyde"
4375id=xlate catalog=libast text="OPTIONS"
4376id=xlate catalog=libast text="algorithm"
4377id=xlate catalog=libast text="method"
4378id=xlate catalog=libast text="again|back"
4379id=xlate catalog=libast text="EXAMPLES"
4380id=xlate catalog=libast text="Examples."
4381id=xlate catalog=libast text="Foo bar."
4382id=xlate catalog=libast text="\abar\a"
4383id=xlate catalog=libast text="Bar foo."
4384id=xlate catalog=libast text="More e.g."
4385id=xlate catalog=libast text="AHA"
4386id=xlate catalog=libast text="IMPLEMENTATION"
4387id=xlate catalog=libast text="SYNOPSIS"
4388id=xlate catalog=libast text="options"
4389return=? option=- name=--man num=0
4390id=xlate catalog=libast text="Usage"'
4391		ERROR - $'BCGVBAF
4392  -a, --nytbevguz|algorithm=zrgubq
4393  -b, --ntnva|onpx|again|back
4394
4395RKNZCYRF
4396  Rknzcyrf.
4397    foo   Sbb one.
4398    one   One sbb.
4399
4400  Zber r.t.
4401    aha   NUN
4402
4403FLABCFVF
4404  xlate [ bcgvbaf ]
4405
4406VZCYRZRAGNGVBA
4407  irefvba         kyngr 1.0
4408  nhgube          Pby. Ulqr'
4409	EXEC -+ xlate "$usage" --?-auth
4410		OUTPUT - $'id=xlate catalog=libast text="version"
4411id=xlate catalog=libast text="version"
4412id=xlate catalog=libast text="author"
4413id=xlate catalog=libast text="author?Col. Hyde][a:algorithm]:[method][b:again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4414id=xlate catalog=libast text="author"
4415id=xlate catalog=libast text="Col. Hyde"
4416id=xlate catalog=libast text="algorithm"
4417id=xlate catalog=libast text="algorithm]:[method][b:again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4418id=xlate catalog=libast text="again|back"
4419id=xlate catalog=libast text="again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4420return=? option=-? name=--?-auth num=0
4421id=xlate catalog=libast text="Usage"'
4422		ERROR - $'  nhgube          Pby. Ulqr'
4423		EXIT 2
4424	EXEC -+ xlate "$usage" --?-nhgu
4425		OUTPUT - $'id=xlate catalog=libast text="version"
4426id=xlate catalog=libast text="version"
4427id=xlate catalog=libast text="author"
4428id=xlate catalog=libast text="author?Col. Hyde][a:algorithm]:[method][b:again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4429id=xlate catalog=libast text="author"
4430id=xlate catalog=libast text="Col. Hyde"
4431id=xlate catalog=libast text="algorithm"
4432id=xlate catalog=libast text="algorithm]:[method][b:again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4433id=xlate catalog=libast text="again|back"
4434id=xlate catalog=libast text="again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4435return=? option=-? name=--?-nhgu num=0
4436id=xlate catalog=libast text="Usage"'
4437		ERROR - $'  nhgube          Pby. Ulqr'
4438	EXEC -+ xlate "$usage" --zna
4439		OUTPUT - $'id=xlate catalog=libast text="algorithm"
4440id=xlate catalog=libast text="again|back"
4441id=xlate catalog=libast text="about"
4442id=xlate catalog=libast text="api"
4443id=xlate catalog=libast text="help"
4444id=xlate catalog=libast text="html"
4445id=xlate catalog=libast text="keys"
4446id=xlate catalog=libast text="long"
4447id=xlate catalog=libast text="man"
4448id=xlate catalog=libast text="about"
4449id=xlate catalog=libast text="api"
4450id=xlate catalog=libast text="help"
4451id=xlate catalog=libast text="html"
4452id=xlate catalog=libast text="keys"
4453id=xlate catalog=libast text="long"
4454id=xlate catalog=libast text="man"
4455id=xlate catalog=libast text="version"
4456id=xlate catalog=libast text="xlate 1.0
4457"
4458id=xlate catalog=libast text="author"
4459id=xlate catalog=libast text="Col. Hyde"
4460id=xlate catalog=libast text="OPTIONS"
4461id=xlate catalog=libast text="algorithm"
4462id=xlate catalog=libast text="method"
4463id=xlate catalog=libast text="again|back"
4464id=xlate catalog=libast text="EXAMPLES"
4465id=xlate catalog=libast text="Examples."
4466id=xlate catalog=libast text="Foo bar."
4467id=xlate catalog=libast text="\abar\a"
4468id=xlate catalog=libast text="Bar foo."
4469id=xlate catalog=libast text="More e.g."
4470id=xlate catalog=libast text="AHA"
4471id=xlate catalog=libast text="IMPLEMENTATION"
4472id=xlate catalog=libast text="SYNOPSIS"
4473id=xlate catalog=libast text="options"
4474return=? option=- name=--zna num=0
4475id=xlate catalog=libast text="Usage"'
4476		ERROR - $'BCGVBAF
4477  -a, --nytbevguz|algorithm=zrgubq
4478  -b, --ntnva|onpx|again|back
4479
4480RKNZCYRF
4481  Rknzcyrf.
4482    foo   Sbb one.
4483    one   One sbb.
4484
4485  Zber r.t.
4486    aha   NUN
4487
4488FLABCFVF
4489  xlate [ bcgvbaf ]
4490
4491VZCYRZRAGNGVBA
4492  irefvba         kyngr 1.0
4493  nhgube          Pby. Ulqr'
4494		EXIT 2
4495	EXEC -+ xlate "$usage" --??zna
4496		OUTPUT - $'id=xlate catalog=libast text="about"
4497id=xlate catalog=libast text="api"
4498id=xlate catalog=libast text="help"
4499id=xlate catalog=libast text="html"
4500id=xlate catalog=libast text="keys"
4501id=xlate catalog=libast text="long"
4502id=xlate catalog=libast text="man"
4503id=xlate catalog=libast text="version"
4504id=xlate catalog=libast text="xlate 1.0
4505"
4506id=xlate catalog=libast text="author"
4507id=xlate catalog=libast text="Col. Hyde"
4508id=xlate catalog=libast text="OPTIONS"
4509id=xlate catalog=libast text="algorithm"
4510id=xlate catalog=libast text="method"
4511id=xlate catalog=libast text="again|back"
4512id=xlate catalog=libast text="EXAMPLES"
4513id=xlate catalog=libast text="Examples."
4514id=xlate catalog=libast text="Foo bar."
4515id=xlate catalog=libast text="\abar\a"
4516id=xlate catalog=libast text="Bar foo."
4517id=xlate catalog=libast text="More e.g."
4518id=xlate catalog=libast text="AHA"
4519id=xlate catalog=libast text="IMPLEMENTATION"
4520id=xlate catalog=libast text="SYNOPSIS"
4521id=xlate catalog=libast text="options"
4522return=? option=-? name=--??zna num=0
4523id=xlate catalog=libast text="Usage"'
4524	EXEC -+ xlate "$usage" --?again
4525		OUTPUT - $'id=xlate catalog=libast text="algorithm"
4526id=xlate catalog=libast text="algorithm]:[method][b:again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4527id=xlate catalog=libast text="again|back"
4528id=xlate catalog=libast text="again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4529id=xlate catalog=libast text="OPTIONS"
4530id=xlate catalog=libast text="again|back"
4531id=xlate catalog=libast text="options"
4532return=? option=-? name=--?again num=0
4533id=xlate catalog=libast text="Usage"'
4534		ERROR - $'Hfntr: xlate [ bcgvbaf ]
4535BCGVBAF
4536  -b, --ntnva|onpx|again|back'
4537		EXIT 2
4538	EXEC -+ xlate "$usage" --?ntnva
4539		OUTPUT - $'id=xlate catalog=libast text="algorithm"
4540id=xlate catalog=libast text="algorithm]:[method][b:again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4541id=xlate catalog=libast text="again|back"
4542id=xlate catalog=libast text="again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4543id=xlate catalog=libast text="OPTIONS"
4544id=xlate catalog=libast text="again|back"
4545id=xlate catalog=libast text="options"
4546return=? option=-? name=--?ntnva num=0
4547id=xlate catalog=libast text="Usage"'
4548		ERROR - $'Hfntr: xlate [ bcgvbaf ]
4549BCGVBAF
4550  -b, --ntnva|onpx|again|back'
4551	EXEC -+ xlate "$usage" --?back
4552		OUTPUT - $'id=xlate catalog=libast text="algorithm"
4553id=xlate catalog=libast text="algorithm]:[method][b:again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4554id=xlate catalog=libast text="again|back"
4555id=xlate catalog=libast text="again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4556id=xlate catalog=libast text="OPTIONS"
4557id=xlate catalog=libast text="again|back"
4558id=xlate catalog=libast text="options"
4559return=? option=-? name=--?back num=0
4560id=xlate catalog=libast text="Usage"'
4561	 	ERROR - $'Hfntr: xlate [ bcgvbaf ]
4562BCGVBAF
4563  -b, --ntnva|onpx|again|back'
4564	EXEC -+ xlate "$usage" --?onpx
4565		OUTPUT - $'id=xlate catalog=libast text="algorithm"
4566id=xlate catalog=libast text="algorithm]:[method][b:again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4567id=xlate catalog=libast text="again|back"
4568id=xlate catalog=libast text="again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4569id=xlate catalog=libast text="OPTIONS"
4570id=xlate catalog=libast text="again|back"
4571id=xlate catalog=libast text="options"
4572return=? option=-? name=--?onpx num=0
4573id=xlate catalog=libast text="Usage"'
4574		ERROR - $'Hfntr: xlate [ bcgvbaf ]
4575BCGVBAF
4576  -b, --ntnva|onpx|again|back'
4577	EXEC -+ xlate "$usage" --?+EXAMPLES
4578		OUTPUT - $'id=xlate catalog=libast text="algorithm"
4579id=xlate catalog=libast text="algorithm]:[method][b:again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4580id=xlate catalog=libast text="again|back"
4581id=xlate catalog=libast text="again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4582id=xlate catalog=libast text="EXAMPLES"
4583id=xlate catalog=libast text="EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4584id=xlate catalog=libast text="Examples."
4585id=xlate catalog=libast text="Foo bar."
4586id=xlate catalog=libast text="\abar\a"
4587id=xlate catalog=libast text="Bar foo."
4588id=xlate catalog=libast text="More e.g."
4589id=xlate catalog=libast text="AHA"
4590return=? option=-? name=--?+EXAMPLES num=0
4591id=xlate catalog=libast text="Usage"'
4592		ERROR - $'  EXAMPLES        Rknzcyrf.
4593                    foo   Sbb one.
4594                    one   One sbb.
4595                  Zber r.t.
4596                    aha   NUN'
4597	EXEC -+ xlate "$usage" --?+EX
4598		OUTPUT - $'id=xlate catalog=libast text="algorithm"
4599id=xlate catalog=libast text="algorithm]:[method][b:again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4600id=xlate catalog=libast text="again|back"
4601id=xlate catalog=libast text="again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4602id=xlate catalog=libast text="EXAMPLES"
4603id=xlate catalog=libast text="EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4604id=xlate catalog=libast text="Examples."
4605id=xlate catalog=libast text="Foo bar."
4606id=xlate catalog=libast text="\abar\a"
4607id=xlate catalog=libast text="Bar foo."
4608id=xlate catalog=libast text="More e.g."
4609id=xlate catalog=libast text="AHA"
4610return=? option=-? name=--?+EX num=0
4611id=xlate catalog=libast text="Usage"'
4612		ERROR - $'  EXAMPLES        Rknzcyrf.
4613                    foo   Sbb one.
4614                    one   One sbb.
4615                  Zber r.t.
4616                    aha   NUN'
4617	EXEC -+ xlate "$usage" --?+RKNZCYRF
4618		OUTPUT - $'id=xlate catalog=libast text="algorithm"
4619id=xlate catalog=libast text="algorithm]:[method][b:again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4620id=xlate catalog=libast text="again|back"
4621id=xlate catalog=libast text="again|back][+EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4622id=xlate catalog=libast text="EXAMPLES"
4623id=xlate catalog=libast text="EXAMPLES?Examples.]{[+foo?Foo bar.][+\abar\a?Bar foo.]}[+?More e.g.]{[+aha?AHA]}"
4624id=xlate catalog=libast text="Examples."
4625id=xlate catalog=libast text="Foo bar."
4626id=xlate catalog=libast text="\abar\a"
4627id=xlate catalog=libast text="Bar foo."
4628id=xlate catalog=libast text="More e.g."
4629id=xlate catalog=libast text="AHA"
4630return=? option=-? name=--?+RKNZCYRF num=0
4631id=xlate catalog=libast text="Usage"'
4632		ERROR - $'  EXAMPLES        Rknzcyrf.
4633                    foo   Sbb one.
4634                    one   One sbb.
4635                  Zber r.t.
4636                    aha   NUN'
4637	usage=$'[-?\n@(#)xlate 1.0\n][-author?Col. Hyde][a:algorithm?\fone\f]:[method]{[+?\fthree\f]}[b:again|back?\ftwo\f]'
4638	EXEC -+ xlate "$usage" --keys
4639		OUTPUT - $'id=xlate catalog=libast text="algorithm"
4640id=xlate catalog=libast text="again|back"
4641id=xlate catalog=libast text="about"
4642id=xlate catalog=libast text="api"
4643id=xlate catalog=libast text="help"
4644id=xlate catalog=libast text="html"
4645id=xlate catalog=libast text="keys"
4646id=xlate catalog=libast text="about"
4647id=xlate catalog=libast text="api"
4648id=xlate catalog=libast text="help"
4649id=xlate catalog=libast text="html"
4650id=xlate catalog=libast text="keys"
4651return=? option=- name=--keys num=0
4652id=xlate catalog=libast text="Usage"'
4653		ERROR - $'"algorithm"
4654"\\fone\\f"
4655"method"
4656"\\fthree\\f"
4657"again|back"
4658"\\ftwo\\f"'
4659		EXIT 2
4660	EXEC -+ xlate "$usage" --usage
4661		OUTPUT - $'id=xlate catalog=libast text="algorithm"
4662id=xlate catalog=libast text="again|back"
4663id=xlate catalog=libast text="about"
4664id=xlate catalog=libast text="api"
4665id=xlate catalog=libast text="help"
4666id=xlate catalog=libast text="html"
4667id=xlate catalog=libast text="keys"
4668id=xlate catalog=libast text="long"
4669id=xlate catalog=libast text="man"
4670id=xlate catalog=libast text="nroff"
4671id=xlate catalog=libast text="options"
4672id=xlate catalog=libast text="posix"
4673id=xlate catalog=libast text="short"
4674id=xlate catalog=libast text="usage"
4675id=xlate catalog=libast text="about"
4676id=xlate catalog=libast text="api"
4677id=xlate catalog=libast text="help"
4678id=xlate catalog=libast text="html"
4679id=xlate catalog=libast text="keys"
4680id=xlate catalog=libast text="long"
4681id=xlate catalog=libast text="man"
4682id=xlate catalog=libast text="nroff"
4683id=xlate catalog=libast text="options"
4684id=xlate catalog=libast text="posix"
4685id=xlate catalog=libast text="short"
4686id=xlate catalog=libast text="usage"
4687return=? option=- name=--usage num=0
4688id=xlate catalog=libast text="Usage"'
4689		ERROR - $'[-?\\n@(#)xlate 1.0\\n][-author?Col. Hyde][a:algorithm?<* one info ok *>]:[method]{[+?<* three info ok *>]}[b:again|back?<* two info ok *>]'
4690
4691TEST 99 'detailed key strings' # this test must be last
4692	usage=$'[-?\naha\n][-catalog?SpamCo][Q:quote?Quote names according to \astyle\a:]:[style:=question]{\n\t[c:C?C "..." style.]\t[e:escape?\b\\\b escape if necessary.]\t[A:always?Always shell style.]\t[101:shell?Shell quote if necessary.]\t[q:question|huh?Replace unknown chars with ?.]\n}[x:exec|run?Just do it.]:?[action:=default]'
4693	EXEC ls "$usage" --man
4694		EXIT 2
4695		OUTPUT - 'return=? option=- name=--man num=0'
4696		ERROR - 'SYNOPSIS
4697  ls [ options ]
4698
4699OPTIONS
4700  -Q, --quote=style
4701                  Quote names according to style:
4702                    c|C   C "..." style.
4703                    escape
4704                          \ escape if necessary.
4705                    A|always
4706                          Always shell style.
4707                    shell Shell quote if necessary.
4708                    question|huh
4709                          Replace unknown chars with ?.
4710                  The default value is question.
4711  -x, --exec|run[=action]
4712                  Just do it. The option value may be omitted. The default
4713                  value is default.
4714
4715IMPLEMENTATION
4716  version         aha
4717  catalog         SpamCo'
4718	EXEC ls "$usage" --keys
4719		OUTPUT - 'return=? option=- name=--keys num=0'
4720		ERROR - '"catalog"
4721"quote"
4722"Quote names according to \astyle\a:"
4723"style:=question"
4724"C \"...\" style."
4725"escape"
4726"\b\\\b escape if necessary."
4727"always"
4728"Always shell style."
4729"shell"
4730"Shell quote if necessary."
4731"question|huh"
4732"Replace unknown chars with ?."
4733"exec|run"
4734"Just do it."
4735"action:=default"'
4736
4737	EXPORT	LC_ALL=debug LC_MESSAGES=debug
4738
4739	IF '[[ $(LC_ALL=debug $COMMAND query "[-][+NAME]" --man 2>&1 >/dev/null) == "(libast,3,325)"* ]]'
4740
4741	EXEC ls "$usage" --man
4742		OUTPUT - 'return=? option=- name=--man num=0'
4743		ERROR - '(libast,3,372)
4744  ls [ (libast,3,709) ]
4745
4746(libast,3,333)
4747  -Q, --(debug,ls,SpamCo,quote)|quote=(debug,ls,SpamCo,style:=question)
4748                  (debug,ls,SpamCo,Quote names according to style:)
4749                    (debug,ls,SpamCo,C)
4750                          (debug,ls,SpamCo,C "..." style.)
4751                    (debug,ls,SpamCo,escape)
4752                          (debug,ls,SpamCo,\ escape if necessary.)
4753                    (debug,ls,SpamCo,always)
4754                          (debug,ls,SpamCo,Always shell style.)
4755                    (debug,ls,SpamCo,shell)
4756                          (debug,ls,SpamCo,Shell quote if necessary.)
4757                    (debug,ls,SpamCo,question|huh)
4758                          (debug,ls,SpamCo,Replace unknown chars with ?.)
4759                  (debug,ls,SpamCo,(libast,3,400) question.)
4760  -x, --(debug,ls,SpamCo,exec|run)|exec|run[=(debug,ls,SpamCo,action:=default)]
4761                  (debug,ls,SpamCo,Just do it.) (libast,3,401) (libast,3,400)
4762                  default.
4763
4764(libast,3,238)
4765  (libast,3,812)  (debug,ls,SpamCo,aha )
4766  (libast,3,499)  (debug,ls,SpamCo,SpamCo)'
4767
4768	usage=$'[-][+NAME?small]\n\nfile\n\n[+SEE?\btbig\b(1)]'
4769	EXEC small "$usage" --man
4770		EXIT 2
4771		OUTPUT - $'return=? option=- name=--man num=0'
4772		ERROR - '(libast,3,325)
4773  (debug,small,libast,small)
4774
4775(libast,3,372)
4776  small [ (libast,3,709) ] (debug,small,libast,file)
4777
4778(debug,small,libast,SEE)
4779  (debug,small,libast,tbig(1))'
4780
4781	usage=$'[-][Y:layout?Listing layout \akey\a:]:[key]{\n[a:across|horizontal?Multi-column across the page.][1:single-column?One column down the page.]\n}'
4782	EXEC ls "$usage" --man
4783		ERROR - '(libast,3,372)
4784  ls [ (libast,3,709) ]
4785
4786(libast,3,333)
4787  -Y, --(debug,ls,libast,layout)|layout=(debug,ls,libast,key)
4788                  (debug,ls,libast,Listing layout key:)
4789                    (debug,ls,libast,across|horizontal)
4790                          (debug,ls,libast,Multi-column across the page.)
4791                    (debug,ls,libast,single-column)
4792                          (debug,ls,libast,One column down the page.)'
4793	ELSE '$INSTALLROOT/share/lib/locale/C/LC_MESSAGES/libast not installed'
4794
4795	EXEC ls "$usage" --man
4796		OUTPUT - 'return=? option=- name=--man num=0'
4797		ERROR - '(debug,ls,libast,"SYNOPSIS")
4798  ls [ (debug,ls,libast,"options") ]
4799
4800(debug,ls,libast,"OPTIONS")
4801  -Y, --(debug,ls,libast,"layout")|layout=(debug,ls,libast,"key")
4802                  (debug,ls,libast,"Listing layout key:")
4803                    (debug,ls,libast,"across|horizontal")
4804                          (debug,ls,libast,"Multi-column across the page.")
4805                    (debug,ls,libast,"single-column")
4806                          (debug,ls,libast,"One column down the page.")'
4807
4808	usage=$'[-][+NAME?small]\n\nfile\n\n[+SEE?\btbig\b(1)]'
4809	EXEC small "$usage" --man
4810		EXIT 2
4811		OUTPUT - $'return=? option=- name=--man num=0'
4812		ERROR - $'(debug,small,libast,"NAME")
4813  (debug,small,libast,"small")
4814
4815(debug,small,libast,"SYNOPSIS")
4816  small [ (debug,small,libast,"options") ] (debug,small,libast,"file")
4817
4818(debug,small,libast,"SEE")
4819  (debug,small,libast,"tbig(1)")'
4820
4821	usage=$'[-][Y:layout?Listing layout \akey\a:]:[key]{\n[a:across|horizontal?Multi-column across the page.][1:single-column?One column down the page.]\n}'
4822	EXEC ls "$usage" --man
4823		ERROR - $'(debug,ls,libast,"SYNOPSIS")
4824  ls [ (debug,ls,libast,"options") ]
4825
4826(debug,ls,libast,"OPTIONS")
4827  -Y, --(debug,ls,libast,"layout")|layout=(debug,ls,libast,"key")
4828                  (debug,ls,libast,"Listing layout key:")
4829                    (debug,ls,libast,"across|horizontal")
4830                          (debug,ls,libast,"Multi-column across the page.")
4831                    (debug,ls,libast,"single-column")
4832                          (debug,ls,libast,"One column down the page.")'
4833
4834	FI
4835