xref: /netbsd-src/external/bsd/ntp/dist/sntp/libopts/genshell.c (revision f8cf1a9151c7af1cb0bd8b09c13c66bca599c027)
1 /*	$NetBSD: genshell.c,v 1.6 2024/08/18 20:47:24 christos Exp $	*/
2 
3 /*   -*- buffer-read-only: t -*- vi: set ro:
4  *
5  *  DO NOT EDIT THIS FILE   (genshell.c)
6  *
7  *  It has been AutoGen-ed
8  *  From the definitions    genshell.def
9  *  and the template file   options
10  *
11  * Generated from AutoOpts 42:1:17 templates.
12  *
13  *  AutoOpts is a copyrighted work.  This source file is not encumbered
14  *  by AutoOpts licensing, but is provided under the licensing terms chosen
15  *  by the genshellopt author or copyright holder.  AutoOpts is
16  *  licensed under the terms of the LGPL.  The redistributable library
17  *  (``libopts'') is licensed under the terms of either the LGPL or, at the
18  *  users discretion, the BSD license.  See the AutoOpts and/or libopts sources
19  *  for details.
20  *
21  * The genshellopt program is copyrighted and licensed
22  * under the following terms:
23  *
24  *  Copyright (C) 1999-2018 Bruce Korb, all rights reserved.
25  *  This is free software. It is licensed for use, modification and
26  *  redistribution under the terms of the GNU Lesser General Public License,
27  *  version 2 or later <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>
28  *
29  *  The genshellopt library is free software; you can redistribute it and/or
30  *  modify it under the terms of the GNU Library General Public License as
31  *  published by the Free Software Foundation; either version 2 of the
32  *  License, or (at your option) any later version.
33  *
34  *  This library is distributed in the hope that it will be useful, but
35  *  WITHOUT ANY WARRANTY; without even the implied warranty of
36  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
37  *  Library General Public License for more details.
38  *
39  *  You should have received a copy of the GNU Library General Public
40  *  License along with this library; if not, see
41  *  <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>
42  */
43 
44 #ifndef __doxygen__
45 #define OPTION_CODE_COMPILE 1
46 #include "genshell.h"
47 #include <sys/types.h>
48 #include <sys/stat.h>
49 
50 #include <errno.h>
51 #include <fcntl.h>
52 #include <limits.h>
53 #include <stdio.h>
54 #include <stdlib.h>
55 #include <string.h>
56 #include <unistd.h>
57 
58 #ifdef  __cplusplus
59 extern "C" {
60 #endif
61 extern FILE * option_usage_fp;
62 #define zCopyright      (genshellopt_opt_strs+0)
63 #define zLicenseDescrip (genshellopt_opt_strs+285)
64 
65 extern tUsageProc genshelloptUsage;
66 
67 #ifndef NULL
68 #  define NULL 0
69 #endif
70 
71 /**
72  *  static const strings for genshellopt options
73  */
74 static char const genshellopt_opt_strs[1769] =
75 /*     0 */ "genshellopt 1\n"
76             "Copyright (C) 1999-2018 Bruce Korb, all rights reserved.\n"
77             "This is free software. It is licensed for use, modification and\n"
78             "redistribution under the terms of the GNU Lesser General Public License,\n"
79             "version 2 or later <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>\n\0"
80 /*   285 */ "The genshellopt library is free software; you can redistribute it and/or\n"
81             "modify it under the terms of the GNU Library General Public License as\n"
82             "published by the Free Software Foundation; either version 2 of the License,\n"
83             "or (at your option) any later version.\n\n"
84             "This library is distributed in the hope that it will be useful, but WITHOUT\n"
85             "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n"
86             "FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public\n"
87             "License for more details.\n\n"
88             "You should have received a copy of the GNU Library General Public License\n"
89             "along with this library; if not, see\n"
90             "<http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>\n\0"
91 /*   957 */ "Output Script File\0"
92 /*   976 */ "SCRIPT\0"
93 /*   983 */ "script\0"
94 /*   990 */ "Shell name (follows \"#!\" magic)\0"
95 /*  1022 */ "SHELL\0"
96 /*  1028 */ "no-shell\0"
97 /*  1037 */ "no\0"
98 /*  1040 */ "display extended usage information and exit\0"
99 /*  1084 */ "help\0"
100 /*  1089 */ "extended usage information passed thru pager\0"
101 /*  1134 */ "more-help\0"
102 /*  1144 */ "output version information and exit\0"
103 /*  1180 */ "version\0"
104 /*  1188 */ "GENSHELLOPT\0"
105 /*  1200 */ "genshellopt - Generate Shell Option Processing Script - Ver. 1\n"
106             "Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
107 /*  1321 */ "autogen-users@lists.sourceforge.net\0"
108 /*  1357 */ "Note that 'shell' is only useful if the output file does not already exist.\n"
109             "If it does, then the shell name and optional first argument will be\n"
110             "extracted from the script file.\n\0"
111 /*  1534 */ "If the script file already exists and contains Automated Option Processing\n"
112             "text, the second line of the file through the ending tag will be replaced\n"
113             "by the newly generated text.  The first '#!' line will be regenerated.\n\0"
114 /*  1755 */ "genshellopt 1";
115 
116 /**
117  *  script option description:
118  */
119 /** Descriptive text for the script option */
120 #define SCRIPT_DESC      (genshellopt_opt_strs+957)
121 /** Upper-cased name for the script option */
122 #define SCRIPT_NAME      (genshellopt_opt_strs+976)
123 /** Name string for the script option */
124 #define SCRIPT_name      (genshellopt_opt_strs+983)
125 /** Compiled in flag settings for the script option */
126 #define SCRIPT_FLAGS     (OPTST_DISABLED \
127         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
128 
129 /**
130  *  shell option description:
131  */
132 /** Descriptive text for the shell option */
133 #define SHELL_DESC      (genshellopt_opt_strs+990)
134 /** Upper-cased name for the shell option */
135 #define SHELL_NAME      (genshellopt_opt_strs+1022)
136 /** disablement name for the shell option */
137 #define NOT_SHELL_name  (genshellopt_opt_strs+1028)
138 /** disablement prefix for the shell option */
139 #define NOT_SHELL_PFX   (genshellopt_opt_strs+1037)
140 /** Name string for the shell option */
141 #define SHELL_name      (NOT_SHELL_name + 3)
142 /** Compiled in flag settings for the shell option */
143 #define SHELL_FLAGS     (OPTST_INITENABLED \
144         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
145 
146 /*
147  *  Help/More_Help/Version option descriptions:
148  */
149 #define HELP_DESC       (genshellopt_opt_strs+1040)
150 #define HELP_name       (genshellopt_opt_strs+1084)
151 #ifdef HAVE_WORKING_FORK
152 #define MORE_HELP_DESC  (genshellopt_opt_strs+1089)
153 #define MORE_HELP_name  (genshellopt_opt_strs+1134)
154 #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
155 #else
156 #define MORE_HELP_DESC  HELP_DESC
157 #define MORE_HELP_name  HELP_name
158 #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
159 #endif
160 #ifdef NO_OPTIONAL_OPT_ARGS
161 #  define VER_FLAGS     (OPTST_IMM | OPTST_NO_INIT)
162 #else
163 #  define VER_FLAGS     (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
164                          OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
165 #endif
166 #define VER_DESC        (genshellopt_opt_strs+1144)
167 #define VER_name        (genshellopt_opt_strs+1180)
168 /**
169  *  Declare option callback procedures
170  */
171 extern tOptProc
172     optionBooleanVal,   optionNestedVal,    optionNumericVal,
173     optionPagedUsage,   optionPrintVersion, optionResetOpt,
174     optionStackArg,     optionTimeDate,     optionTimeVal,
175     optionUnstackArg,   optionVendorOption;
176 static tOptProc
177     doUsageOpt;
178 #define VER_PROC        optionPrintVersion
179 
180 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
181 /**
182  *  Define the genshellopt Option Descriptions.
183  * This is an array of GENSHELL_OPTION_CT entries, one for each
184  * option that the genshellopt program responds to.
185  */
186 static tOptDesc optDesc[GENSHELL_OPTION_CT] = {
187   {  /* entry idx, value */ 0, VALUE_GENSHELL_OPT_SCRIPT,
188      /* equiv idx, value */ 0, VALUE_GENSHELL_OPT_SCRIPT,
189      /* equivalenced to  */ NO_EQUIVALENT,
190      /* min, max, act ct */ 0, 1, 0,
191      /* opt state flags  */ SCRIPT_FLAGS, 0,
192      /* last opt argumnt */ { NULL }, /* --script */
193      /* arg list/cookie  */ NULL,
194      /* must/cannot opts */ NULL, NULL,
195      /* option proc      */ NULL,
196      /* desc, NAME, name */ SCRIPT_DESC, SCRIPT_NAME, SCRIPT_name,
197      /* disablement strs */ NULL, NULL },
198 
199   {  /* entry idx, value */ 1, VALUE_GENSHELL_OPT_SHELL,
200      /* equiv idx, value */ 1, VALUE_GENSHELL_OPT_SHELL,
201      /* equivalenced to  */ NO_EQUIVALENT,
202      /* min, max, act ct */ 0, 1, 0,
203      /* opt state flags  */ SHELL_FLAGS, 0,
204      /* last opt argumnt */ { NULL }, /* --shell */
205      /* arg list/cookie  */ NULL,
206      /* must/cannot opts */ NULL, NULL,
207      /* option proc      */ NULL,
208      /* desc, NAME, name */ SHELL_DESC, SHELL_NAME, SHELL_name,
209      /* disablement strs */ NOT_SHELL_name, NOT_SHELL_PFX },
210 
211   {  /* entry idx, value */ INDEX_GENSHELL_OPT_VERSION, VALUE_GENSHELL_OPT_VERSION,
212      /* equiv idx value  */ NO_EQUIVALENT, VALUE_GENSHELL_OPT_VERSION,
213      /* equivalenced to  */ NO_EQUIVALENT,
214      /* min, max, act ct */ 0, 1, 0,
215      /* opt state flags  */ VER_FLAGS, AOUSE_VERSION,
216      /* last opt argumnt */ { NULL },
217      /* arg list/cookie  */ NULL,
218      /* must/cannot opts */ NULL, NULL,
219      /* option proc      */ VER_PROC,
220      /* desc, NAME, name */ VER_DESC, NULL, VER_name,
221      /* disablement strs */ NULL, NULL },
222 
223 
224 
225   {  /* entry idx, value */ INDEX_GENSHELL_OPT_HELP, VALUE_GENSHELL_OPT_HELP,
226      /* equiv idx value  */ NO_EQUIVALENT, VALUE_GENSHELL_OPT_HELP,
227      /* equivalenced to  */ NO_EQUIVALENT,
228      /* min, max, act ct */ 0, 1, 0,
229      /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
230      /* last opt argumnt */ { NULL },
231      /* arg list/cookie  */ NULL,
232      /* must/cannot opts */ NULL, NULL,
233      /* option proc      */ doUsageOpt,
234      /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
235      /* disablement strs */ NULL, NULL },
236 
237   {  /* entry idx, value */ INDEX_GENSHELL_OPT_MORE_HELP, VALUE_GENSHELL_OPT_MORE_HELP,
238      /* equiv idx value  */ NO_EQUIVALENT, VALUE_GENSHELL_OPT_MORE_HELP,
239      /* equivalenced to  */ NO_EQUIVALENT,
240      /* min, max, act ct */ 0, 1, 0,
241      /* opt state flags  */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
242      /* last opt argumnt */ { NULL },
243      /* arg list/cookie  */ NULL,
244      /* must/cannot opts */ NULL,  NULL,
245      /* option proc      */ optionPagedUsage,
246      /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
247      /* disablement strs */ NULL, NULL }
248 };
249 
250 
251 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
252 /** Reference to the upper cased version of genshellopt. */
253 #define zPROGNAME       (genshellopt_opt_strs+1188)
254 /** Reference to the title line for genshellopt usage. */
255 #define zUsageTitle     (genshellopt_opt_strs+1200)
256 /** There is no genshellopt configuration file. */
257 #define zRcName         NULL
258 /** There are no directories to search for genshellopt config files. */
259 #define apzHomeList     NULL
260 /** The genshellopt program bug email address. */
261 #define zBugsAddr       (genshellopt_opt_strs+1321)
262 /** Clarification/explanation of what genshellopt does. */
263 #define zExplain        (genshellopt_opt_strs+1357)
264 /** Extra detail explaining what genshellopt does. */
265 #define zDetail         (genshellopt_opt_strs+1534)
266 /** The full version string for genshellopt. */
267 #define zFullVersion    (genshellopt_opt_strs+1755)
268 /* extracted from optcode.tlib near line 342 */
269 
270 #if defined(ENABLE_NLS)
271 # define OPTPROC_BASE OPTPROC_TRANSLATE
272   static tOptionXlateProc translate_option_strings;
273 #else
274 # define OPTPROC_BASE OPTPROC_NONE
275 # define translate_option_strings NULL
276 #endif /* ENABLE_NLS */
277 
278 #define genshellopt_full_usage (NULL)
279 #define genshellopt_short_usage (NULL)
280 
281 #endif /* not defined __doxygen__ */
282 
283 /*
284  *  Create the static procedure(s) declared above.
285  */
286 /**
287  * The callout function that invokes the genshelloptUsage function.
288  *
289  * @param[in] opts the AutoOpts option description structure
290  * @param[in] od   the descriptor for the "help" (usage) option.
291  * @noreturn
292  */
293 static void
294 doUsageOpt(tOptions * opts, tOptDesc * od)
295 {
296     int ex_code;
297     ex_code = GENSHELLOPT_EXIT_SUCCESS;
298     genshelloptUsage(&genshelloptOptions, ex_code);
299     /* NOTREACHED */
300     exit(GENSHELLOPT_EXIT_FAILURE);
301     (void)opts;
302     (void)od;
303 }
304 /* extracted from optmain.tlib near line 1250 */
305 
306 /**
307  * The directory containing the data associated with genshellopt.
308  */
309 #ifndef  PKGDATADIR
310 # define PKGDATADIR ""
311 #endif
312 
313 /**
314  * Information about the person or institution that packaged genshellopt
315  * for the current distribution.
316  */
317 #ifndef  WITH_PACKAGER
318 # define genshellopt_packager_info NULL
319 #else
320 /** Packager information for genshellopt. */
321 static char const genshellopt_packager_info[] =
322     "Packaged by " WITH_PACKAGER
323 
324 # ifdef WITH_PACKAGER_VERSION
325         " ("WITH_PACKAGER_VERSION")"
326 # endif
327 
328 # ifdef WITH_PACKAGER_BUG_REPORTS
329     "\nReport genshellopt bugs to " WITH_PACKAGER_BUG_REPORTS
330 # endif
331     "\n";
332 #endif
333 #ifndef __doxygen__
334 
335 #endif /* __doxygen__ */
336 /**
337  * The option definitions for genshellopt.  The one structure that
338  * binds them all.
339  */
340 tOptions genshelloptOptions = {
341     OPTIONS_STRUCT_VERSION,
342     0, NULL,                    /* original argc + argv    */
343     ( OPTPROC_BASE
344     + OPTPROC_ERRSTOP
345     + OPTPROC_SHORTOPT
346     + OPTPROC_LONGOPT
347     + OPTPROC_NO_REQ_OPT
348     + OPTPROC_NEGATIONS
349     + OPTPROC_NO_ARGS ),
350     0, NULL,                    /* current option index, current option */
351     NULL,         NULL,         zPROGNAME,
352     zRcName,      zCopyright,   zLicenseDescrip,
353     zFullVersion, apzHomeList,  zUsageTitle,
354     zExplain,     zDetail,      optDesc,
355     zBugsAddr,                  /* address to send bugs to */
356     NULL, NULL,                 /* extensions/saved state  */
357     genshelloptUsage, /* usage procedure */
358     translate_option_strings,   /* translation procedure */
359     /*
360      *  Indexes to special options
361      */
362     { INDEX_GENSHELL_OPT_MORE_HELP, /* more-help option index */
363       NO_EQUIVALENT, /* save option index */
364       NO_EQUIVALENT, /* '-#' option index */
365       NO_EQUIVALENT /* index of default opt */
366     },
367     5 /* full option count */, 2 /* user option count */,
368     genshellopt_full_usage, genshellopt_short_usage,
369     NULL, NULL,
370     PKGDATADIR, genshellopt_packager_info
371 };
372 
373 #if ENABLE_NLS
374 /**
375  * This code is designed to translate translatable option text for the
376  * genshellopt program.  These translations happen upon entry
377  * to optionProcess().
378  */
379 #include <stdio.h>
380 #include <stdlib.h>
381 #include <string.h>
382 #include <unistd.h>
383 #ifdef HAVE_DCGETTEXT
384 # include <gettext.h>
385 #endif
386 #include <autoopts/usage-txt.h>
387 
388 static char * AO_gettext(char const * pz);
389 static void   coerce_it(void ** s);
390 
391 /**
392  * AutoGen specific wrapper function for gettext.  It relies on the macro _()
393  * to convert from English to the target language, then strdup-duplicates the
394  * result string.  It tries the "libopts" domain first, then whatever has been
395  * set via the \a textdomain(3) call.
396  *
397  * @param[in] pz the input text used as a lookup key.
398  * @returns the translated text (if there is one),
399  *   or the original text (if not).
400  */
401 static char *
402 AO_gettext(char const * pz)
403 {
404     char * res;
405     if (pz == NULL)
406         return NULL;
407 #ifdef HAVE_DCGETTEXT
408     /*
409      * While processing the option_xlateable_txt data, try to use the
410      * "libopts" domain.  Once we switch to the option descriptor data,
411      * do *not* use that domain.
412      */
413     if (option_xlateable_txt.field_ct != 0) {
414         res = dgettext("libopts", pz);
415         if (res == pz)
416             res = (char *)VOIDP(_(pz));
417     } else
418         res = (char *)VOIDP(_(pz));
419 #else
420     res = (char *)VOIDP(_(pz));
421 #endif
422     if (res == pz)
423         return res;
424     res = strdup(res);
425     if (res == NULL) {
426         fputs(_("No memory for duping translated strings\n"), stderr);
427         exit(GENSHELLOPT_EXIT_FAILURE);
428     }
429     return res;
430 }
431 
432 /**
433  * All the pointers we use are marked "* const", but they are stored in
434  * writable memory.  Coerce the mutability and set the pointer.
435  */
436 static void coerce_it(void ** s) { *s = AO_gettext(*s);
437 }
438 
439 /**
440  * Translate all the translatable strings in the genshelloptOptions
441  * structure defined above.  This is done only once.
442  */
443 static void
444 translate_option_strings(void)
445 {
446     tOptions * const opts = &genshelloptOptions;
447 
448     /*
449      *  Guard against re-translation.  It won't work.  The strings will have
450      *  been changed by the first pass through this code.  One shot only.
451      */
452     if (option_xlateable_txt.field_ct != 0) {
453         /*
454          *  Do the translations.  The first pointer follows the field count
455          *  field.  The field count field is the size of a pointer.
456          */
457         char ** ppz = (char**)VOIDP(&(option_xlateable_txt));
458         int     ix  = option_xlateable_txt.field_ct;
459 
460         do {
461             ppz++; /* skip over field_ct */
462             *ppz = AO_gettext(*ppz);
463         } while (--ix > 0);
464         /* prevent re-translation and disable "libopts" domain lookup */
465         option_xlateable_txt.field_ct = 0;
466 
467         coerce_it(VOIDP(&(opts->pzCopyright)));
468         coerce_it(VOIDP(&(opts->pzCopyNotice)));
469         coerce_it(VOIDP(&(opts->pzFullVersion)));
470         coerce_it(VOIDP(&(opts->pzUsageTitle)));
471         coerce_it(VOIDP(&(opts->pzExplain)));
472         coerce_it(VOIDP(&(opts->pzDetail)));
473         {
474             tOptDesc * od = opts->pOptDesc;
475             for (ix = opts->optCt; ix > 0; ix--, od++)
476                 coerce_it(VOIDP(&(od->pzText)));
477         }
478     }
479 }
480 #endif /* ENABLE_NLS */
481 
482 #ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
483 /** I18N function strictly for xgettext.  Do not compile. */
484 static void bogus_function(void) {
485   /* TRANSLATORS:
486 
487      The following dummy function was crated solely so that xgettext can
488      extract the correct strings.  These strings are actually referenced
489      by a field name in the genshelloptOptions structure noted in the
490      comments below.  The literal text is defined in genshellopt_opt_strs.
491 
492      NOTE: the strings below are segmented with respect to the source string
493      genshellopt_opt_strs.  The strings above are handed off for translation
494      at run time a paragraph at a time.  Consequently, they are presented here
495      for translation a paragraph at a time.
496 
497      ALSO: often the description for an option will reference another option
498      by name.  These are set off with apostrophe quotes (I hope).  Do not
499      translate option names.
500    */
501   /* referenced via genshelloptOptions.pzCopyright */
502   puts(_("genshellopt 1\n\
503 Copyright (C) 1999-2018 Bruce Korb, all rights reserved.\n\
504 This is free software. It is licensed for use, modification and\n\
505 redistribution under the terms of the GNU Lesser General Public License,\n\
506 version 2 or later <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>\n"));
507 
508   /* referenced via genshelloptOptions.pzCopyNotice */
509   puts(_("The genshellopt library is free software; you can redistribute it and/or\n\
510 modify it under the terms of the GNU Library General Public License as\n\
511 published by the Free Software Foundation; either version 2 of the License,\n\
512 or (at your option) any later version.\n\n"));
513   puts(_("This library is distributed in the hope that it will be useful, but WITHOUT\n\
514 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n\
515 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public\n\
516 License for more details.\n\n"));
517   puts(_("You should have received a copy of the GNU Library General Public License\n\
518 along with this library; if not, see\n\
519 <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>\n"));
520 
521   /* referenced via genshelloptOptions.pOptDesc->pzText */
522   puts(_("Output Script File"));
523 
524   /* referenced via genshelloptOptions.pOptDesc->pzText */
525   puts(_("Shell name (follows \"#!\" magic)"));
526 
527   /* referenced via genshelloptOptions.pOptDesc->pzText */
528   puts(_("display extended usage information and exit"));
529 
530   /* referenced via genshelloptOptions.pOptDesc->pzText */
531   puts(_("extended usage information passed thru pager"));
532 
533   /* referenced via genshelloptOptions.pOptDesc->pzText */
534   puts(_("output version information and exit"));
535 
536   /* referenced via genshelloptOptions.pzUsageTitle */
537   puts(_("genshellopt - Generate Shell Option Processing Script - Ver. 1\n\
538 Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
539 
540   /* referenced via genshelloptOptions.pzExplain */
541   puts(_("Note that 'shell' is only useful if the output file does not already exist.\n\
542 If it does, then the shell name and optional first argument will be\n\
543 extracted from the script file.\n"));
544 
545   /* referenced via genshelloptOptions.pzDetail */
546   puts(_("If the script file already exists and contains Automated Option Processing\n\
547 text, the second line of the file through the ending tag will be replaced\n\
548 by the newly generated text.  The first '#!' line will be regenerated.\n"));
549 
550   /* referenced via genshelloptOptions.pzFullVersion */
551   puts(_("genshellopt 1"));
552 
553   /* referenced via genshelloptOptions.pzFullUsage */
554   puts(_("<<<NOT-FOUND>>>"));
555 
556   /* referenced via genshelloptOptions.pzShortUsage */
557   puts(_("<<<NOT-FOUND>>>"));
558   /* LIBOPTS-MESSAGES: */
559 #line 67 "../autoopts.c"
560   puts(_("allocation of %d bytes failed\n"));
561 #line 89 "../autoopts.c"
562   puts(_("allocation of %d bytes failed\n"));
563 #line 48 "../init.c"
564   puts(_("AutoOpts function called without option descriptor\n"));
565 #line 81 "../init.c"
566   puts(_("\tThis exceeds the compiled library version:  "));
567 #line 79 "../init.c"
568   puts(_("Automated Options Processing Error!\n"
569        "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
570 #line 78 "../autoopts.c"
571   puts(_("realloc of %d bytes at 0x%p failed\n"));
572 #line 83 "../init.c"
573   puts(_("\tThis is less than the minimum library version:  "));
574 #line 121 "../version.c"
575   puts(_("Automated Options version %s\n"
576        "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
577 #line 49 "../makeshell.c"
578   puts(_("(AutoOpts bug):  %s.\n"));
579 #line 90 "../reset.c"
580   puts(_("optionResetOpt() called, but reset-option not configured"));
581 #line 241 "../usage.c"
582   puts(_("could not locate the 'help' option"));
583 #line 330 "../autoopts.c"
584   puts(_("optionProcess() was called with invalid data"));
585 #line 697 "../usage.c"
586   puts(_("invalid argument type specified"));
587 #line 568 "../find.c"
588   puts(_("defaulted to option with optional arg"));
589 #line 76 "../alias.c"
590   puts(_("aliasing option is out of range."));
591 #line 210 "../enum.c"
592   puts(_("%s error:  the keyword '%s' is ambiguous for %s\n"));
593 #line 78 "../find.c"
594   puts(_("  The following options match:\n"));
595 #line 263 "../find.c"
596   puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
597 #line 161 "../check.c"
598   puts(_("%s: Command line arguments required\n"));
599 #line 43 "../alias.c"
600   puts(_("%d %s%s options allowed\n"));
601 #line 56 "../makeshell.c"
602   puts(_("%s error %d (%s) calling %s for '%s'\n"));
603 #line 268 "../makeshell.c"
604   puts(_("interprocess pipe"));
605 #line 171 "../version.c"
606   puts(_("error: version option argument '%c' invalid.  Use:\n"
607        "\t'v' - version only\n"
608        "\t'c' - version and copyright\n"
609        "\t'n' - version and full copyright notice\n"));
610 #line 58 "../check.c"
611   puts(_("%s error:  the '%s' and '%s' options conflict\n"));
612 #line 187 "../find.c"
613   puts(_("%s: The '%s' option has been disabled."));
614 #line 400 "../find.c"
615   puts(_("%s: The '%s' option has been disabled."));
616 #line 38 "../alias.c"
617   puts(_("-equivalence"));
618 #line 439 "../find.c"
619   puts(_("%s: illegal option -- %c\n"));
620 #line 110 "../reset.c"
621   puts(_("%s: illegal option -- %c\n"));
622 #line 241 "../find.c"
623   puts(_("%s: illegal option -- %s\n"));
624 #line 740 "../find.c"
625   puts(_("%s: illegal option -- %s\n"));
626 #line 118 "../reset.c"
627   puts(_("%s: illegal option -- %s\n"));
628 #line 305 "../find.c"
629   puts(_("%s: unknown vendor extension option -- %s\n"));
630 #line 135 "../enum.c"
631   puts(_("  or an integer from %d through %d\n"));
632 #line 145 "../enum.c"
633   puts(_("  or an integer from %d through %d\n"));
634 #line 696 "../usage.c"
635   puts(_("%s error:  invalid option descriptor for %s\n"));
636 #line 1030 "../usage.c"
637   puts(_("%s error:  invalid option descriptor for %s\n"));
638 #line 355 "../find.c"
639   puts(_("%s: invalid option name: %s\n"));
640 #line 497 "../find.c"
641   puts(_("%s: The '%s' option requires an argument.\n"));
642 #line 150 "../autoopts.c"
643   puts(_("(AutoOpts bug):  Equivalenced option '%s' was equivalenced to both\n"
644        "\t'%s' and '%s'."));
645 #line 94 "../check.c"
646   puts(_("%s error:  The %s option is required\n"));
647 #line 602 "../find.c"
648   puts(_("%s: The '%s' option cannot have an argument.\n"));
649 #line 151 "../check.c"
650   puts(_("%s: Command line arguments are not allowed.\n"));
651 #line 568 "../save.c"
652   puts(_("error %d (%s) creating %s\n"));
653 #line 210 "../enum.c"
654   puts(_("%s error:  '%s' does not match any %s keywords.\n"));
655 #line 93 "../reset.c"
656   puts(_("%s error: The '%s' option requires an argument.\n"));
657 #line 122 "../save.c"
658   puts(_("error %d (%s) stat-ing %s\n"));
659 #line 175 "../save.c"
660   puts(_("error %d (%s) stat-ing %s\n"));
661 #line 143 "../restore.c"
662   puts(_("%s error: no saved option state\n"));
663 #line 225 "../autoopts.c"
664   puts(_("'%s' is not a command line option.\n"));
665 #line 113 "../time.c"
666   puts(_("%s error:  '%s' is not a recognizable date/time.\n"));
667 #line 50 "../time.c"
668   puts(_("%s error:  '%s' is not a recognizable time duration.\n"));
669 #line 92 "../check.c"
670   puts(_("%s error:  The %s option must appear %d times.\n"));
671 #line 165 "../numeric.c"
672   puts(_("%s error:  '%s' is not a recognizable number.\n"));
673 #line 176 "../enum.c"
674   puts(_("%s error:  %s exceeds %s keyword count\n"));
675 #line 279 "../usage.c"
676   puts(_("Try '%s %s' for more information.\n"));
677 #line 45 "../alias.c"
678   puts(_("one %s%s option allowed\n"));
679 #line 170 "../makeshell.c"
680   puts(_("standard output"));
681 #line 905 "../makeshell.c"
682   puts(_("standard output"));
683 #line 223 "../usage.c"
684   puts(_("standard output"));
685 #line 364 "../usage.c"
686   puts(_("standard output"));
687 #line 574 "../usage.c"
688   puts(_("standard output"));
689 #line 178 "../version.c"
690   puts(_("standard output"));
691 #line 223 "../usage.c"
692   puts(_("standard error"));
693 #line 364 "../usage.c"
694   puts(_("standard error"));
695 #line 574 "../usage.c"
696   puts(_("standard error"));
697 #line 178 "../version.c"
698   puts(_("standard error"));
699 #line 170 "../makeshell.c"
700   puts(_("write"));
701 #line 905 "../makeshell.c"
702   puts(_("write"));
703 #line 222 "../usage.c"
704   puts(_("write"));
705 #line 363 "../usage.c"
706   puts(_("write"));
707 #line 573 "../usage.c"
708   puts(_("write"));
709 #line 177 "../version.c"
710   puts(_("write"));
711 #line 60 "../numeric.c"
712   puts(_("%s error:  %s option value %ld is out of range.\n"));
713 #line 44 "../check.c"
714   puts(_("%s error:  %s option requires the %s option\n"));
715 #line 121 "../save.c"
716   puts(_("%s warning:  cannot save options - %s not regular file\n"));
717 #line 174 "../save.c"
718   puts(_("%s warning:  cannot save options - %s not regular file\n"));
719 #line 193 "../save.c"
720   puts(_("%s warning:  cannot save options - %s not regular file\n"));
721 #line 567 "../save.c"
722   puts(_("%s warning:  cannot save options - %s not regular file\n"));
723   /* END-LIBOPTS-MESSAGES */
724 
725   /* USAGE-TEXT: */
726 #line 822 "../usage.c"
727   puts(_("\t\t\t\t- an alternate for '%s'\n"));
728 #line 1097 "../usage.c"
729   puts(_("Version, usage and configuration options:"));
730 #line 873 "../usage.c"
731   puts(_("\t\t\t\t- default option for unnamed options\n"));
732 #line 786 "../usage.c"
733   puts(_("\t\t\t\t- disabled as '--%s'\n"));
734 #line 1066 "../usage.c"
735   puts(_(" --- %-14s %s\n"));
736 #line 1064 "../usage.c"
737   puts(_("This option has been disabled"));
738 #line 813 "../usage.c"
739   puts(_("\t\t\t\t- enabled by default\n"));
740 #line 40 "../alias.c"
741   puts(_("%s error:  only "));
742 #line 1143 "../usage.c"
743   puts(_(" - examining environment variables named %s_*\n"));
744 #line 168 "../file.c"
745   puts(_("\t\t\t\t- file must not pre-exist\n"));
746 #line 172 "../file.c"
747   puts(_("\t\t\t\t- file must pre-exist\n"));
748 #line 329 "../usage.c"
749   puts(_("Options are specified by doubled hyphens and their name or by a single\n"
750        "hyphen and the flag character.\n"));
751 #line 882 "../makeshell.c"
752   puts(_("\n"
753        "= = = = = = = =\n\n"
754        "This incarnation of genshell will produce\n"
755        "a shell script to parse the options for %s:\n\n"));
756 #line 142 "../enum.c"
757   puts(_("  or an integer mask with any of the lower %d bits set\n"));
758 #line 846 "../usage.c"
759   puts(_("\t\t\t\t- is a set membership option\n"));
760 #line 867 "../usage.c"
761   puts(_("\t\t\t\t- must appear between %d and %d times\n"));
762 #line 331 "../usage.c"
763   puts(_("Options are specified by single or double hyphens and their name.\n"));
764 #line 853 "../usage.c"
765   puts(_("\t\t\t\t- may appear multiple times\n"));
766 #line 840 "../usage.c"
767   puts(_("\t\t\t\t- may not be preset\n"));
768 #line 1258 "../usage.c"
769   puts(_("   Arg Option-Name    Description\n"));
770 #line 1194 "../usage.c"
771   puts(_("  Flg Arg Option-Name    Description\n"));
772 #line 1252 "../usage.c"
773   puts(_("  Flg Arg Option-Name    Description\n"));
774 #line 1253 "../usage.c"
775   puts(_(" %3s %s"));
776 #line 1259 "../usage.c"
777   puts(_(" %3s %s"));
778 #line 336 "../usage.c"
779   puts(_("The '-#<number>' option may omit the hash char\n"));
780 #line 332 "../usage.c"
781   puts(_("All arguments are named options.\n"));
782 #line 920 "../usage.c"
783   puts(_(" - reading file %s"));
784 #line 358 "../usage.c"
785   puts(_("\n"
786        "Please send bug reports to:  <%s>\n"));
787 #line 100 "../version.c"
788   puts(_("\n"
789        "Please send bug reports to:  <%s>\n"));
790 #line 129 "../version.c"
791   puts(_("\n"
792        "Please send bug reports to:  <%s>\n"));
793 #line 852 "../usage.c"
794   puts(_("\t\t\t\t- may NOT appear - preset only\n"));
795 #line 893 "../usage.c"
796   puts(_("\n"
797        "The following option preset mechanisms are supported:\n"));
798 #line 1141 "../usage.c"
799   puts(_("\n"
800        "The following option preset mechanisms are supported:\n"));
801 #line 631 "../usage.c"
802   puts(_("prohibits these options:\n"));
803 #line 626 "../usage.c"
804   puts(_("prohibits the option '%s'\n"));
805 #line 81 "../numeric.c"
806   puts(_("%s%ld to %ld"));
807 #line 79 "../numeric.c"
808   puts(_("%sgreater than or equal to %ld"));
809 #line 75 "../numeric.c"
810   puts(_("%s%ld exactly"));
811 #line 68 "../numeric.c"
812   puts(_("%sit must lie in one of the ranges:\n"));
813 #line 68 "../numeric.c"
814   puts(_("%sit must be in the range:\n"));
815 #line 88 "../numeric.c"
816   puts(_(", or\n"));
817 #line 66 "../numeric.c"
818   puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
819 #line 77 "../numeric.c"
820   puts(_("%sless than or equal to %ld"));
821 #line 339 "../usage.c"
822   puts(_("Operands and options may be intermixed.  They will be reordered.\n"));
823 #line 601 "../usage.c"
824   puts(_("requires the option '%s'\n"));
825 #line 604 "../usage.c"
826   puts(_("requires these options:\n"));
827 #line 1270 "../usage.c"
828   puts(_("   Arg Option-Name   Req?  Description\n"));
829 #line 1264 "../usage.c"
830   puts(_("  Flg Arg Option-Name   Req?  Description\n"));
831 #line 143 "../enum.c"
832   puts(_("or you may use a numeric representation.  Preceding these with a '!'\n"
833        "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
834        "will set them all.  Multiple entries may be passed as an option\n"
835        "argument list.\n"));
836 #line 859 "../usage.c"
837   puts(_("\t\t\t\t- may appear up to %d times\n"));
838 #line 52 "../enum.c"
839   puts(_("The valid \"%s\" option keywords are:\n"));
840 #line 1101 "../usage.c"
841   puts(_("The next option supports vendor supported extra options:"));
842 #line 722 "../usage.c"
843   puts(_("These additional options are:"));
844   /* END-USAGE-TEXT */
845 }
846 #endif /* uncompilable code */
847 #ifdef  __cplusplus
848 }
849 #endif
850 /* genshell.c ends here */
851