summaryrefslogtreecommitdiff
path: root/autoopts/test/usage.test
blob: 33a21a53af97ea5d23ec61ba060ca2429267e6db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
#! /bin/sh
#  -*- Mode: Shell-script -*-
# ----------------------------------------------------------------------
# usage.test ---  test all the ways usage text can be printed.
#
## Time-stamp:      "2011-08-07 17:20:27 bkorb"
# Author:           Bruce Korb <bkorb@gnu.org>
##
##  This file is part of AutoOpts, a companion to AutoGen.
##  AutoOpts is free software.
##  AutoOpts is Copyright (c) 1992-2012 by Bruce Korb - all rights reserved
##
##  AutoOpts is available under any one of two licenses.  The license
##  in use must be one of these two and the choice is under the control
##  of the user of the license.
##
##   The GNU Lesser General Public License, version 3 or later
##      See the files "COPYING.lgplv3" and "COPYING.gplv3"
##
##   The Modified Berkeley Software Distribution License
##      See the file "COPYING.mbsd"
##
##  These files have the following md5sums:
##
##  43b91e8ca915626ed3818ffb1b71248b pkg/libopts/COPYING.gplv3
##  06a1a2e4760c90ea5e1dad8dfaac4d39 pkg/libopts/COPYING.lgplv3
##  66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd
#
# ----------------------------------------------------------------------

${VERBOSE} && kill_delay=10 || kill_delay=5
. ./defs

# # # # # # # # # # HELP OUTPUT FILE # # # # # # # # #

# ============= usage_LGFRA.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_LGFRA.hlp'
test_usage_LGFRA - Checkout usage_LGFRA Options
USAGE:  usage_LGFRA { -<flag> [<val>] | --<name>[{=| }<val>] }... \
		cmd-arg ...
X
X   -L, --check-dirs=str       Checkout directory list
X       --show-defs[=arg]      Show the definition tree
X   -?, --help                 Display extended usage information and exit
X   -!, --more-help            Extended usage information passed thru pager
SHAR_EOF

# ============= usage_LGFRp.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_LGFRp.hlp'
test_usage_LGFRp - Checkout usage_LGFRp Options
USAGE:  usage_LGFRp { -<flag> | --<name> }... cmd-arg ...
X
X   -L, --check-dirs           Checkout directory list
X       --show-defs            Show the definition tree
X   -?, --help                 Display extended usage information and exit
X   -!, --more-help            Extended usage information passed thru pager
SHAR_EOF

# ============= usage_LGFoA.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_LGFoA.hlp'
test_usage_LGFoA - Checkout usage_LGFoA Options
USAGE:  usage_LGFoA [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \
		cmd-arg ...
X
X   -L, --check-dirs=str       Checkout directory list
X       --show-defs[=arg]      Show the definition tree
X   -?, --help                 Display extended usage information and exit
X   -!, --more-help            Extended usage information passed thru pager
SHAR_EOF

# ============= usage_LGFop.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_LGFop.hlp'
test_usage_LGFop - Checkout usage_LGFop Options
USAGE:  usage_LGFop [ -<flag> | --<name> ]... cmd-arg ...
X
X   -L, --check-dirs           Checkout directory list
X       --show-defs            Show the definition tree
X   -?, --help                 Display extended usage information and exit
X   -!, --more-help            Extended usage information passed thru pager
SHAR_EOF

# ============= usage_LGsRA.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_LGsRA.hlp'
test_usage_LGsRA - Checkout usage_LGsRA Options
USAGE:  usage_LGsRA { --<name>[{=| }<val>] }... cmd-arg ...
X
X   --check-dirs=str       Checkout directory list
X   --show-defs[=arg]      Show the definition tree
X   --help                 Display extended usage information and exit
X   --more-help            Extended usage information passed thru pager
SHAR_EOF

# ============= usage_LGsRp.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_LGsRp.hlp'
test_usage_LGsRp - Checkout usage_LGsRp Options
USAGE:  usage_LGsRp { --<name> }... cmd-arg ...
X
X   --check-dirs           Checkout directory list
X   --show-defs            Show the definition tree
X   --help                 Display extended usage information and exit
X   --more-help            Extended usage information passed thru pager
SHAR_EOF

# ============= usage_LGsoA.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_LGsoA.hlp'
test_usage_LGsoA - Checkout usage_LGsoA Options
USAGE:  usage_LGsoA [ --<name>[{=| }<val>] ]... cmd-arg ...
X
X   --check-dirs=str       Checkout directory list
X   --show-defs[=arg]      Show the definition tree
X   --help                 Display extended usage information and exit
X   --more-help            Extended usage information passed thru pager
SHAR_EOF

# ============= usage_LGsop.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_LGsop.hlp'
test_usage_LGsop - Checkout usage_LGsop Options
USAGE:  usage_LGsop [ --<name> ]... cmd-arg ...
X
X   --check-dirs           Checkout directory list
X   --show-defs            Show the definition tree
X   --help                 Display extended usage information and exit
X   --more-help            Extended usage information passed thru pager
SHAR_EOF

# ============= usage_LaFRA.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_LaFRA.hlp'
test_usage_LaFRA - Checkout usage_LaFRA Options
USAGE:  usage_LaFRA { -<flag> [<val>] | --<name>[{=| }<val>] }... \
		cmd-arg ...
X  Flg Arg Option-Name   Req?  Description
X   -L Str check-dirs     YES  Checkout directory list
X      opt show-defs      opt  Show the definition tree
X   -? no  help           opt  Display extended usage information and exit
X   -! no  more-help      opt  Extended usage information passed thru pager
SHAR_EOF

# ============= usage_LaFRp.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_LaFRp.hlp'
test_usage_LaFRp - Checkout usage_LaFRp Options
USAGE:  usage_LaFRp { -<flag> | --<name> }... cmd-arg ...
X  Flg Arg Option-Name   Req?  Description
X   -L no  check-dirs     YES  Checkout directory list
X      no  show-defs      opt  Show the definition tree
X   -? no  help           opt  Display extended usage information and exit
X   -! no  more-help      opt  Extended usage information passed thru pager
SHAR_EOF

# ============= usage_LaFoA.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_LaFoA.hlp'
test_usage_LaFoA - Checkout usage_LaFoA Options
USAGE:  usage_LaFoA [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \
		cmd-arg ...
X  Flg Arg Option-Name    Description
X   -L Str check-dirs     Checkout directory list
X      opt show-defs      Show the definition tree
X   -? no  help           Display extended usage information and exit
X   -! no  more-help      Extended usage information passed thru pager
SHAR_EOF

# ============= usage_LaFop.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_LaFop.hlp'
test_usage_LaFop - Checkout usage_LaFop Options
USAGE:  usage_LaFop [ -<flag> | --<name> ]... cmd-arg ...
X  Flg Arg Option-Name    Description
X   -L no  check-dirs     Checkout directory list
X      no  show-defs      Show the definition tree
X   -? no  help           Display extended usage information and exit
X   -! no  more-help      Extended usage information passed thru pager
SHAR_EOF

# ============= usage_LasRA.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_LasRA.hlp'
test_usage_LasRA - Checkout usage_LasRA Options
USAGE:  usage_LasRA { --<name>[{=| }<val>] }... cmd-arg ...
X   Arg Option-Name   Req?  Description
X   Str check-dirs     YES  Checkout directory list
X   opt show-defs      opt  Show the definition tree
X   no  help           opt  Display extended usage information and exit
X   no  more-help      opt  Extended usage information passed thru pager
SHAR_EOF

# ============= usage_LasRp.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_LasRp.hlp'
test_usage_LasRp - Checkout usage_LasRp Options
USAGE:  usage_LasRp { --<name> }... cmd-arg ...
X   Arg Option-Name   Req?  Description
X   no  check-dirs     YES  Checkout directory list
X   no  show-defs      opt  Show the definition tree
X   no  help           opt  Display extended usage information and exit
X   no  more-help      opt  Extended usage information passed thru pager
SHAR_EOF

# ============= usage_LasoA.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_LasoA.hlp'
test_usage_LasoA - Checkout usage_LasoA Options
USAGE:  usage_LasoA [ --<name>[{=| }<val>] ]... cmd-arg ...
X   Arg Option-Name    Description
X   Str check-dirs     Checkout directory list
X   opt show-defs      Show the definition tree
X   no  help           Display extended usage information and exit
X   no  more-help      Extended usage information passed thru pager
SHAR_EOF

# ============= usage_Lasop.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_Lasop.hlp'
test_usage_Lasop - Checkout usage_Lasop Options
USAGE:  usage_Lasop [ --<name> ]... cmd-arg ...
X   Arg Option-Name    Description
X   no  check-dirs     Checkout directory list
X   no  show-defs      Show the definition tree
X   no  help           Display extended usage information and exit
X   no  more-help      Extended usage information passed thru pager
SHAR_EOF

# ============= usage_sGFRA.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_sGFRA.hlp'
test_usage_sGFRA - Checkout usage_sGFRA Options
USAGE:  usage_sGFRA { -<flag> [<val>] }... cmd-arg ...
X
X   -L str     Checkout directory list
X   -s [arg]   Show the definition tree
X   -?         Display extended usage information and exit
X   -!         Extended usage information passed thru pager
SHAR_EOF

# ============= usage_sGFRp.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_sGFRp.hlp'
test_usage_sGFRp - Checkout usage_sGFRp Options
USAGE:  usage_sGFRp { -<flag> }... cmd-arg ...
X
X   -L         Checkout directory list
X   -s         Show the definition tree
X   -?         Display extended usage information and exit
X   -!         Extended usage information passed thru pager
SHAR_EOF

# ============= usage_sGFoA.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_sGFoA.hlp'
test_usage_sGFoA - Checkout usage_sGFoA Options
USAGE:  usage_sGFoA [ -<flag> [<val>] ]... cmd-arg ...
X
X   -L str     Checkout directory list
X   -s [arg]   Show the definition tree
X   -?         Display extended usage information and exit
X   -!         Extended usage information passed thru pager
SHAR_EOF

# ============= usage_sGFop.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_sGFop.hlp'
test_usage_sGFop - Checkout usage_sGFop Options
USAGE:  usage_sGFop [ -<flag> ]... cmd-arg ...
X
X   -L         Checkout directory list
X   -s         Show the definition tree
X   -?         Display extended usage information and exit
X   -!         Extended usage information passed thru pager
SHAR_EOF

# ============= usage_sGsRA.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_sGsRA.hlp'
test_usage_sGsRA - Checkout usage_sGsRA Options
USAGE:  usage_sGsRA { <option-name>[{=| }<val>] }...
X
X   check-dirs=str         Checkout directory list
X   show-defs[=arg]        Show the definition tree
X   help                   Display extended usage information and exit
X   more-help              Extended usage information passed thru pager
SHAR_EOF

# ============= usage_sGsRp.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_sGsRp.hlp'
test_usage_sGsRp - Checkout usage_sGsRp Options
USAGE:  usage_sGsRp { <option-name> }...
X
X   check-dirs             Checkout directory list
X   show-defs              Show the definition tree
X   help                   Display extended usage information and exit
X   more-help              Extended usage information passed thru pager
SHAR_EOF

# ============= usage_sGsoA.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_sGsoA.hlp'
test_usage_sGsoA - Checkout usage_sGsoA Options
USAGE:  usage_sGsoA [ <option-name>[{=| }<val>] ]...
X
X   check-dirs=str         Checkout directory list
X   show-defs[=arg]        Show the definition tree
X   help                   Display extended usage information and exit
X   more-help              Extended usage information passed thru pager
SHAR_EOF

# ============= usage_sGsop.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_sGsop.hlp'
test_usage_sGsop - Checkout usage_sGsop Options
USAGE:  usage_sGsop [ <option-name> ]...
X
X   check-dirs             Checkout directory list
X   show-defs              Show the definition tree
X   help                   Display extended usage information and exit
X   more-help              Extended usage information passed thru pager
SHAR_EOF

# ============= usage_saFRA.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_saFRA.hlp'
test_usage_saFRA - Checkout usage_saFRA Options
USAGE:  usage_saFRA { -<flag> [<val>] }... cmd-arg ...
X  Flg Arg Option-Name   Req?  Description
X   -L Str check-dirs     YES  Checkout directory list
X   -s opt show-defs      opt  Show the definition tree
X   -? no  help           opt  Display extended usage information and exit
X   -! no  more-help      opt  Extended usage information passed thru pager
SHAR_EOF

# ============= usage_saFRp.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_saFRp.hlp'
test_usage_saFRp - Checkout usage_saFRp Options
USAGE:  usage_saFRp { -<flag> }... cmd-arg ...
X  Flg Arg Option-Name   Req?  Description
X   -L no  check-dirs     YES  Checkout directory list
X   -s no  show-defs      opt  Show the definition tree
X   -? no  help           opt  Display extended usage information and exit
X   -! no  more-help      opt  Extended usage information passed thru pager
SHAR_EOF

# ============= usage_saFoA.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_saFoA.hlp'
test_usage_saFoA - Checkout usage_saFoA Options
USAGE:  usage_saFoA [ -<flag> [<val>] ]... cmd-arg ...
X  Flg Arg Option-Name    Description
X   -L Str check-dirs     Checkout directory list
X   -s opt show-defs      Show the definition tree
X   -? no  help           Display extended usage information and exit
X   -! no  more-help      Extended usage information passed thru pager
SHAR_EOF

# ============= usage_saFop.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_saFop.hlp'
test_usage_saFop - Checkout usage_saFop Options
USAGE:  usage_saFop [ -<flag> ]... cmd-arg ...
X  Flg Arg Option-Name    Description
X   -L no  check-dirs     Checkout directory list
X   -s no  show-defs      Show the definition tree
X   -? no  help           Display extended usage information and exit
X   -! no  more-help      Extended usage information passed thru pager
SHAR_EOF

# ============= usage_sasRA.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_sasRA.hlp'
test_usage_sasRA - Checkout usage_sasRA Options
USAGE:  usage_sasRA { <option-name>[{=| }<val>] }...
X   Arg Option-Name   Req?  Description
X   Str check-dirs     YES  Checkout directory list
X   opt show-defs      opt  Show the definition tree
X   no  help           opt  Display extended usage information and exit
X   no  more-help      opt  Extended usage information passed thru pager
SHAR_EOF

# ============= usage_sasRp.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_sasRp.hlp'
test_usage_sasRp - Checkout usage_sasRp Options
USAGE:  usage_sasRp { <option-name> }...
X   Arg Option-Name   Req?  Description
X   no  check-dirs     YES  Checkout directory list
X   no  show-defs      opt  Show the definition tree
X   no  help           opt  Display extended usage information and exit
X   no  more-help      opt  Extended usage information passed thru pager
SHAR_EOF

# ============= usage_sasoA.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_sasoA.hlp'
test_usage_sasoA - Checkout usage_sasoA Options
USAGE:  usage_sasoA [ <option-name>[{=| }<val>] ]...
X   Arg Option-Name    Description
X   Str check-dirs     Checkout directory list
X   opt show-defs      Show the definition tree
X   no  help           Display extended usage information and exit
X   no  more-help      Extended usage information passed thru pager
SHAR_EOF

# ============= usage_sasop.hlp ==============
${SED} 's/^X//;/^[ 	]*$/d' << 'SHAR_EOF' > 'usage_sasop.hlp'
test_usage_sasop - Checkout usage_sasop Options
USAGE:  usage_sasop [ <option-name> ]...
X   Arg Option-Name    Description
X   no  check-dirs     Checkout directory list
X   no  show-defs      Show the definition tree
X   no  help           Display extended usage information and exit
X   no  more-help      Extended usage information passed thru pager
SHAR_EOF

# # # # # # # # # # DEFINITIONS FILES # # # # # # # # #

emit_defs()
{
  exec 4> $1.def
  cat >&4 <<-  _EOF_
	AutoGen Definitions options;
	prog-name  = test_$1;
	prog-title = "Checkout $1 Options";
	config-header = 'config.h';
	test-main;
	_EOF_

  cmd_arg="argument = 'cmd-arg ...';"
  if ${long_opts}
  then
    echo "long-opts;" >&4
    if ${flag_opts}
    then detail="Long and short (flag) options are accepted."
    else detail="Only long options are accepted." ; fi
  else
    if ${flag_opts}
    then detail="Only short (flag) options are accepted."
    else detail="All command line arguments must be named options."
         cmd_arg=''
    fi
  fi

  if ${gnu_usage}
  then
    echo "gnu-usage;" >&4
    detail="${detail}${nl}Usage should be in GNU style."
  else
    detail="${detail}${nl}Usage is in AutoOpts traditional style."
  fi

  cat >&4 <<-  _EOF_
	${cmd_arg}
	flag = {
	    name      = check_dirs;
	    descrip   = "Checkout directory list";
	_EOF_

  if ${flag_opts}
  then
    echo "    value     = L;"      >&4
  fi

  if ${req_opts}
  then
    echo "    min       = '1';"    >&4
    detail="${detail}${nl}The check-dirs option is required."
  else
    detail="${detail}${nl}There are no required options."
  fi

  if ${arg_opts}
  then
    echo "    arg-type  = string;" >&4
    echo "    arg-name  = dir;"    >&4
    detail="${detail}${nl}Some options require arguments."
  else
    detail="${detail}${nl}No options require arguments."
  fi

  cat >&4 <<-  _EOF_
	};

	flag = {
	    name      = show_defs;
	    descrip   = "Show the definition tree";
	_EOF_

  if ${flag_opts}
  then
    ${long_opts} || echo "    value     = s;" >&4
  fi

  if ${arg_opts}
  then
    echo "    arg-type  = number;" >&4
    echo "    arg-name  = depth;"  >&4
    echo "    arg-optional;"       >&4
  fi

  echo "};" >&4
  echo "detail = '${detail}';" >&4

  exec 4>&-
}

run_usage_test() {
  ${arg_opts} && name="${rname}A" || name="${rname}p"
  testname=${tname}_${name}
  emit_defs ${testname}
  test_list="${test_list} ${testname}"
  echo firstline >> ${defnames_raw}
  ${AG_L} ${testname}.def >> ${defnames_raw} || {
    cat ${defnames_raw}
    failure "AutoGen could not process $testname"
  }

  ${SED} \
      -e '1,/definition names looked up/d' \
      -e '/end of looked up def/,$d' ${defnames_raw} \
          ${defnames_raw} >> ${defnames_file}
  compile ${helpstr}
  ${SED} -e '/Extended usage information passed thru pager/q' \
      ${testname}.help > XXX
  mv XXX ${testname}.help
  cmp -s ${testname}.help ${testname}.hlp || \
    failure "FAILED ${testname} hlp -> help
`diff ${testname}.hlp ${testname}.help`"
}

test_list=""
tname=${testname}
defnames_raw=${TMPDIR}/defnames.raw
defnames_file=${TMPDIR}/defnames.uniq
AG_L=${AG_L}\ --used-defines

case "$-" in
*x* ) setx='set -x' ;;
* )   setx='' ;;
esac

stime=$(date +%s)

for long_opts in true false
do
  ${long_opts} && lname=L || lname=s

  for gnu_usage in true false
  do
    ${gnu_usage} && uname="${lname}G" || uname="${lname}a"

    for flag_opts in true false
    do
      ${flag_opts} && fname="${uname}F" || fname="${uname}s"

      if ${long_opts}
      then helpstr=--help

      elif ${flag_opts}
      then helpstr='-?'

      else helpstr=help
      fi

      for req_opts in true false
      do
        ${req_opts} && rname="${fname}R" || rname="${fname}o"

        for arg_opts in true false
        do
          run_usage_test
        done
      done
    done
  done
done

test -z "${DEBUG_USAGE}" && cleanup && exit 0

sort -u -o ${defnames_file} ${defnames_file}
cat > ${defnames_raw} <<- _EOF_
	aliases
	allow_errors
	arg_default
	arg_optional
	arg_range
	arg_type
	argument
	call_proc
	code
	config_header
	copyright
	default
	deprecated
	descrip
	detail
	disable
	documentation
	eaddr
	enable
	enabled
	environrc
	equivalence
	exit_name
	explain
	export
	extract_code
	field
	file_fail_code
	flag
	flag_code
	flag_proc
	flags_cant
	flags_must
	full_usage
	gnu_usage
	guard_option_names
	help_value
	homerc
	ifdef
	ifndef
	immed_disable
	immediate
	include
	lib_name
	library
	long_opts
	main
	main_text
	main_type
	max
	min
	more_help_value
	must_set
	name
	no_command
	no_libopts
	no_misuse_usage
	no_preset
	no_xlate
	nomem_fail_code
	omitted_usage
	package
	prefix
	prefix_enum
	preserve_case
	prog_name
	prog_title
	reorder_args
	resettable
	scaled
	settable
	short_usage
	stack_arg
	std_value
	test_main
	translators
	unstack_arg
	usage
	usage_message
	usage_opt
	usage_type
	val_name
	val_upname
	value
	version
	_EOF_

cmp ${defnames_raw} ${defnames_file} || \
    failure "${defnames_raw} and ${defnames_file} do not compare${nl}`
        diff ${defnames_raw} ${defnames_file}`"
cleanup

## Local Variables:
## mode: shell-script
## indent-tabs-mode: nil
## sh-indentation: 2
## End:

# end of usage.test