xref: /freebsd/contrib/ntp/sntp/libopts/genshell.c (revision a466cc55373fc3cf86837f09da729535b57e69a1)
1ea906c41SOllivier Robert /*   -*- buffer-read-only: t -*- vi: set ro:
2ea906c41SOllivier Robert  *
3ea906c41SOllivier Robert  *  DO NOT EDIT THIS FILE   (genshell.c)
4ea906c41SOllivier Robert  *
52b15cb3dSCy Schubert  *  It has been AutoGen-ed
6ea906c41SOllivier Robert  *  From the definitions    genshell.def
7ea906c41SOllivier Robert  *  and the template file   options
8ea906c41SOllivier Robert  *
9*a466cc55SCy Schubert  * Generated from AutoOpts 42:1:17 templates.
10ea906c41SOllivier Robert  *
112b15cb3dSCy Schubert  *  AutoOpts is a copyrighted work.  This source file is not encumbered
122b15cb3dSCy Schubert  *  by AutoOpts licensing, but is provided under the licensing terms chosen
132b15cb3dSCy Schubert  *  by the genshellopt author or copyright holder.  AutoOpts is
142b15cb3dSCy Schubert  *  licensed under the terms of the LGPL.  The redistributable library
152b15cb3dSCy Schubert  *  (``libopts'') is licensed under the terms of either the LGPL or, at the
162b15cb3dSCy Schubert  *  users discretion, the BSD license.  See the AutoOpts and/or libopts sources
172b15cb3dSCy Schubert  *  for details.
18ea906c41SOllivier Robert  *
192b15cb3dSCy Schubert  * The genshellopt program is copyrighted and licensed
202b15cb3dSCy Schubert  * under the following terms:
21ea906c41SOllivier Robert  *
22*a466cc55SCy Schubert  *  Copyright (C) 1999-2018 Bruce Korb, all rights reserved.
232b15cb3dSCy Schubert  *  This is free software. It is licensed for use, modification and
242b15cb3dSCy Schubert  *  redistribution under the terms of the GNU Lesser General Public License,
252b15cb3dSCy Schubert  *  version 2 or later <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>
26ea906c41SOllivier Robert  *
272b15cb3dSCy Schubert  *  The genshellopt library is free software; you can redistribute it and/or
282b15cb3dSCy Schubert  *  modify it under the terms of the GNU Library General Public License as
292b15cb3dSCy Schubert  *  published by the Free Software Foundation; either version 2 of the
302b15cb3dSCy Schubert  *  License, or (at your option) any later version.
312b15cb3dSCy Schubert  *
322b15cb3dSCy Schubert  *  This library is distributed in the hope that it will be useful, but
332b15cb3dSCy Schubert  *  WITHOUT ANY WARRANTY; without even the implied warranty of
34ea906c41SOllivier Robert  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
352b15cb3dSCy Schubert  *  Library General Public License for more details.
36ea906c41SOllivier Robert  *
372b15cb3dSCy Schubert  *  You should have received a copy of the GNU Library General Public
382b15cb3dSCy Schubert  *  License along with this library; if not, see
392b15cb3dSCy Schubert  *  <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>
40ea906c41SOllivier Robert  */
41ea906c41SOllivier Robert 
422b15cb3dSCy Schubert #ifndef __doxygen__
43ea906c41SOllivier Robert #define OPTION_CODE_COMPILE 1
44ea906c41SOllivier Robert #include "genshell.h"
452b15cb3dSCy Schubert #include <sys/types.h>
46*a466cc55SCy Schubert #include <sys/stat.h>
472b15cb3dSCy Schubert 
48*a466cc55SCy Schubert #include <errno.h>
49*a466cc55SCy Schubert #include <fcntl.h>
502b15cb3dSCy Schubert #include <limits.h>
512b15cb3dSCy Schubert #include <stdio.h>
522b15cb3dSCy Schubert #include <stdlib.h>
53*a466cc55SCy Schubert #include <string.h>
54*a466cc55SCy Schubert #include <unistd.h>
55ea906c41SOllivier Robert 
56ea906c41SOllivier Robert #ifdef  __cplusplus
57ea906c41SOllivier Robert extern "C" {
58ea906c41SOllivier Robert #endif
592b15cb3dSCy Schubert extern FILE * option_usage_fp;
602b15cb3dSCy Schubert #define zCopyright      (genshellopt_opt_strs+0)
612b15cb3dSCy Schubert #define zLicenseDescrip (genshellopt_opt_strs+285)
622b15cb3dSCy Schubert 
63ea906c41SOllivier Robert extern tUsageProc genshelloptUsage;
64ea906c41SOllivier Robert 
65ea906c41SOllivier Robert #ifndef NULL
66ea906c41SOllivier Robert #  define NULL 0
67ea906c41SOllivier Robert #endif
682b15cb3dSCy Schubert 
692b15cb3dSCy Schubert /**
702b15cb3dSCy Schubert  *  static const strings for genshellopt options
71ea906c41SOllivier Robert  */
722b15cb3dSCy Schubert static char const genshellopt_opt_strs[1769] =
732b15cb3dSCy Schubert /*     0 */ "genshellopt 1\n"
74*a466cc55SCy Schubert             "Copyright (C) 1999-2018 Bruce Korb, all rights reserved.\n"
752b15cb3dSCy Schubert             "This is free software. It is licensed for use, modification and\n"
762b15cb3dSCy Schubert             "redistribution under the terms of the GNU Lesser General Public License,\n"
772b15cb3dSCy Schubert             "version 2 or later <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>\n\0"
782b15cb3dSCy Schubert /*   285 */ "The genshellopt library is free software; you can redistribute it and/or\n"
792b15cb3dSCy Schubert             "modify it under the terms of the GNU Library General Public License as\n"
802b15cb3dSCy Schubert             "published by the Free Software Foundation; either version 2 of the License,\n"
812b15cb3dSCy Schubert             "or (at your option) any later version.\n\n"
822b15cb3dSCy Schubert             "This library is distributed in the hope that it will be useful, but WITHOUT\n"
832b15cb3dSCy Schubert             "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n"
842b15cb3dSCy Schubert             "FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public\n"
852b15cb3dSCy Schubert             "License for more details.\n\n"
862b15cb3dSCy Schubert             "You should have received a copy of the GNU Library General Public License\n"
872b15cb3dSCy Schubert             "along with this library; if not, see\n"
882b15cb3dSCy Schubert             "<http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>\n\0"
892b15cb3dSCy Schubert /*   957 */ "Output Script File\0"
902b15cb3dSCy Schubert /*   976 */ "SCRIPT\0"
912b15cb3dSCy Schubert /*   983 */ "script\0"
922b15cb3dSCy Schubert /*   990 */ "Shell name (follows \"#!\" magic)\0"
932b15cb3dSCy Schubert /*  1022 */ "SHELL\0"
942b15cb3dSCy Schubert /*  1028 */ "no-shell\0"
952b15cb3dSCy Schubert /*  1037 */ "no\0"
962b15cb3dSCy Schubert /*  1040 */ "display extended usage information and exit\0"
972b15cb3dSCy Schubert /*  1084 */ "help\0"
982b15cb3dSCy Schubert /*  1089 */ "extended usage information passed thru pager\0"
992b15cb3dSCy Schubert /*  1134 */ "more-help\0"
1002b15cb3dSCy Schubert /*  1144 */ "output version information and exit\0"
1012b15cb3dSCy Schubert /*  1180 */ "version\0"
1022b15cb3dSCy Schubert /*  1188 */ "GENSHELLOPT\0"
1032b15cb3dSCy Schubert /*  1200 */ "genshellopt - Generate Shell Option Processing Script - Ver. 1\n"
1042b15cb3dSCy Schubert             "Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
1052b15cb3dSCy Schubert /*  1321 */ "autogen-users@lists.sourceforge.net\0"
1062b15cb3dSCy Schubert /*  1357 */ "Note that 'shell' is only useful if the output file does not already exist.\n"
1072b15cb3dSCy Schubert             "If it does, then the shell name and optional first argument will be\n"
1082b15cb3dSCy Schubert             "extracted from the script file.\n\0"
1092b15cb3dSCy Schubert /*  1534 */ "If the script file already exists and contains Automated Option Processing\n"
1102b15cb3dSCy Schubert             "text, the second line of the file through the ending tag will be replaced\n"
1112b15cb3dSCy Schubert             "by the newly generated text.  The first '#!' line will be regenerated.\n\0"
1122b15cb3dSCy Schubert /*  1755 */ "genshellopt 1";
1132b15cb3dSCy Schubert 
1142b15cb3dSCy Schubert /**
1152b15cb3dSCy Schubert  *  script option description:
1162b15cb3dSCy Schubert  */
1172b15cb3dSCy Schubert /** Descriptive text for the script option */
1182b15cb3dSCy Schubert #define SCRIPT_DESC      (genshellopt_opt_strs+957)
1192b15cb3dSCy Schubert /** Upper-cased name for the script option */
1202b15cb3dSCy Schubert #define SCRIPT_NAME      (genshellopt_opt_strs+976)
1212b15cb3dSCy Schubert /** Name string for the script option */
1222b15cb3dSCy Schubert #define SCRIPT_name      (genshellopt_opt_strs+983)
1232b15cb3dSCy Schubert /** Compiled in flag settings for the script option */
124ea906c41SOllivier Robert #define SCRIPT_FLAGS     (OPTST_DISABLED \
125ea906c41SOllivier Robert         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
126ea906c41SOllivier Robert 
1272b15cb3dSCy Schubert /**
1282b15cb3dSCy Schubert  *  shell option description:
129ea906c41SOllivier Robert  */
1302b15cb3dSCy Schubert /** Descriptive text for the shell option */
1312b15cb3dSCy Schubert #define SHELL_DESC      (genshellopt_opt_strs+990)
1322b15cb3dSCy Schubert /** Upper-cased name for the shell option */
1332b15cb3dSCy Schubert #define SHELL_NAME      (genshellopt_opt_strs+1022)
1342b15cb3dSCy Schubert /** disablement name for the shell option */
1352b15cb3dSCy Schubert #define NOT_SHELL_name  (genshellopt_opt_strs+1028)
1362b15cb3dSCy Schubert /** disablement prefix for the shell option */
1372b15cb3dSCy Schubert #define NOT_SHELL_PFX   (genshellopt_opt_strs+1037)
1382b15cb3dSCy Schubert /** Name string for the shell option */
1392b15cb3dSCy Schubert #define SHELL_name      (NOT_SHELL_name + 3)
1402b15cb3dSCy Schubert /** Compiled in flag settings for the shell option */
141ea906c41SOllivier Robert #define SHELL_FLAGS     (OPTST_INITENABLED \
142ea906c41SOllivier Robert         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
143ea906c41SOllivier Robert 
144ea906c41SOllivier Robert /*
145ea906c41SOllivier Robert  *  Help/More_Help/Version option descriptions:
146ea906c41SOllivier Robert  */
1472b15cb3dSCy Schubert #define HELP_DESC       (genshellopt_opt_strs+1040)
1482b15cb3dSCy Schubert #define HELP_name       (genshellopt_opt_strs+1084)
1492b15cb3dSCy Schubert #ifdef HAVE_WORKING_FORK
1502b15cb3dSCy Schubert #define MORE_HELP_DESC  (genshellopt_opt_strs+1089)
1512b15cb3dSCy Schubert #define MORE_HELP_name  (genshellopt_opt_strs+1134)
1522b15cb3dSCy Schubert #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
1532b15cb3dSCy Schubert #else
1542b15cb3dSCy Schubert #define MORE_HELP_DESC  HELP_DESC
1552b15cb3dSCy Schubert #define MORE_HELP_name  HELP_name
1562b15cb3dSCy Schubert #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
1572b15cb3dSCy Schubert #endif
1582b15cb3dSCy Schubert #ifdef NO_OPTIONAL_OPT_ARGS
1592b15cb3dSCy Schubert #  define VER_FLAGS     (OPTST_IMM | OPTST_NO_INIT)
1602b15cb3dSCy Schubert #else
1612b15cb3dSCy Schubert #  define VER_FLAGS     (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
1622b15cb3dSCy Schubert                          OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
1632b15cb3dSCy Schubert #endif
1642b15cb3dSCy Schubert #define VER_DESC        (genshellopt_opt_strs+1144)
1652b15cb3dSCy Schubert #define VER_name        (genshellopt_opt_strs+1180)
1662b15cb3dSCy Schubert /**
167ea906c41SOllivier Robert  *  Declare option callback procedures
168ea906c41SOllivier Robert  */
169ea906c41SOllivier Robert extern tOptProc
1702b15cb3dSCy Schubert     optionBooleanVal,   optionNestedVal,    optionNumericVal,
1712b15cb3dSCy Schubert     optionPagedUsage,   optionPrintVersion, optionResetOpt,
1722b15cb3dSCy Schubert     optionStackArg,     optionTimeDate,     optionTimeVal,
1732b15cb3dSCy Schubert     optionUnstackArg,   optionVendorOption;
174ea906c41SOllivier Robert static tOptProc
175ea906c41SOllivier Robert     doUsageOpt;
1762b15cb3dSCy Schubert #define VER_PROC        optionPrintVersion
177ea906c41SOllivier Robert 
1782b15cb3dSCy Schubert /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1792b15cb3dSCy Schubert /**
1802b15cb3dSCy Schubert  *  Define the genshellopt Option Descriptions.
1812b15cb3dSCy Schubert  * This is an array of GENSHELL_OPTION_CT entries, one for each
1822b15cb3dSCy Schubert  * option that the genshellopt program responds to.
183ea906c41SOllivier Robert  */
1842b15cb3dSCy Schubert static tOptDesc optDesc[GENSHELL_OPTION_CT] = {
1852b15cb3dSCy Schubert   {  /* entry idx, value */ 0, VALUE_GENSHELL_OPT_SCRIPT,
1862b15cb3dSCy Schubert      /* equiv idx, value */ 0, VALUE_GENSHELL_OPT_SCRIPT,
187ea906c41SOllivier Robert      /* equivalenced to  */ NO_EQUIVALENT,
188ea906c41SOllivier Robert      /* min, max, act ct */ 0, 1, 0,
189ea906c41SOllivier Robert      /* opt state flags  */ SCRIPT_FLAGS, 0,
1902b15cb3dSCy Schubert      /* last opt argumnt */ { NULL }, /* --script */
191ea906c41SOllivier Robert      /* arg list/cookie  */ NULL,
192ea906c41SOllivier Robert      /* must/cannot opts */ NULL, NULL,
193ea906c41SOllivier Robert      /* option proc      */ NULL,
1942b15cb3dSCy Schubert      /* desc, NAME, name */ SCRIPT_DESC, SCRIPT_NAME, SCRIPT_name,
195ea906c41SOllivier Robert      /* disablement strs */ NULL, NULL },
196ea906c41SOllivier Robert 
1972b15cb3dSCy Schubert   {  /* entry idx, value */ 1, VALUE_GENSHELL_OPT_SHELL,
1982b15cb3dSCy Schubert      /* equiv idx, value */ 1, VALUE_GENSHELL_OPT_SHELL,
199ea906c41SOllivier Robert      /* equivalenced to  */ NO_EQUIVALENT,
200ea906c41SOllivier Robert      /* min, max, act ct */ 0, 1, 0,
201ea906c41SOllivier Robert      /* opt state flags  */ SHELL_FLAGS, 0,
2022b15cb3dSCy Schubert      /* last opt argumnt */ { NULL }, /* --shell */
203ea906c41SOllivier Robert      /* arg list/cookie  */ NULL,
204ea906c41SOllivier Robert      /* must/cannot opts */ NULL, NULL,
205ea906c41SOllivier Robert      /* option proc      */ NULL,
2062b15cb3dSCy Schubert      /* desc, NAME, name */ SHELL_DESC, SHELL_NAME, SHELL_name,
2072b15cb3dSCy Schubert      /* disablement strs */ NOT_SHELL_name, NOT_SHELL_PFX },
208ea906c41SOllivier Robert 
2092b15cb3dSCy Schubert   {  /* entry idx, value */ INDEX_GENSHELL_OPT_VERSION, VALUE_GENSHELL_OPT_VERSION,
2102b15cb3dSCy Schubert      /* equiv idx value  */ NO_EQUIVALENT, VALUE_GENSHELL_OPT_VERSION,
211ea906c41SOllivier Robert      /* equivalenced to  */ NO_EQUIVALENT,
212ea906c41SOllivier Robert      /* min, max, act ct */ 0, 1, 0,
2132b15cb3dSCy Schubert      /* opt state flags  */ VER_FLAGS, AOUSE_VERSION,
214ea906c41SOllivier Robert      /* last opt argumnt */ { NULL },
215ea906c41SOllivier Robert      /* arg list/cookie  */ NULL,
216ea906c41SOllivier Robert      /* must/cannot opts */ NULL, NULL,
2172b15cb3dSCy Schubert      /* option proc      */ VER_PROC,
2182b15cb3dSCy Schubert      /* desc, NAME, name */ VER_DESC, NULL, VER_name,
219ea906c41SOllivier Robert      /* disablement strs */ NULL, NULL },
220ea906c41SOllivier Robert 
221ea906c41SOllivier Robert 
222ea906c41SOllivier Robert 
2232b15cb3dSCy Schubert   {  /* entry idx, value */ INDEX_GENSHELL_OPT_HELP, VALUE_GENSHELL_OPT_HELP,
2242b15cb3dSCy Schubert      /* equiv idx value  */ NO_EQUIVALENT, VALUE_GENSHELL_OPT_HELP,
225ea906c41SOllivier Robert      /* equivalenced to  */ NO_EQUIVALENT,
226ea906c41SOllivier Robert      /* min, max, act ct */ 0, 1, 0,
2272b15cb3dSCy Schubert      /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
228ea906c41SOllivier Robert      /* last opt argumnt */ { NULL },
229ea906c41SOllivier Robert      /* arg list/cookie  */ NULL,
230ea906c41SOllivier Robert      /* must/cannot opts */ NULL, NULL,
231ea906c41SOllivier Robert      /* option proc      */ doUsageOpt,
2322b15cb3dSCy Schubert      /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
233ea906c41SOllivier Robert      /* disablement strs */ NULL, NULL },
234ea906c41SOllivier Robert 
2352b15cb3dSCy Schubert   {  /* entry idx, value */ INDEX_GENSHELL_OPT_MORE_HELP, VALUE_GENSHELL_OPT_MORE_HELP,
2362b15cb3dSCy Schubert      /* equiv idx value  */ NO_EQUIVALENT, VALUE_GENSHELL_OPT_MORE_HELP,
237ea906c41SOllivier Robert      /* equivalenced to  */ NO_EQUIVALENT,
238ea906c41SOllivier Robert      /* min, max, act ct */ 0, 1, 0,
2392b15cb3dSCy Schubert      /* opt state flags  */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
240ea906c41SOllivier Robert      /* last opt argumnt */ { NULL },
241ea906c41SOllivier Robert      /* arg list/cookie  */ NULL,
242ea906c41SOllivier Robert      /* must/cannot opts */ NULL,  NULL,
243ea906c41SOllivier Robert      /* option proc      */ optionPagedUsage,
2442b15cb3dSCy Schubert      /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
245ea906c41SOllivier Robert      /* disablement strs */ NULL, NULL }
246ea906c41SOllivier Robert };
247ea906c41SOllivier Robert 
248ea906c41SOllivier Robert 
2492b15cb3dSCy Schubert /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2502b15cb3dSCy Schubert /** Reference to the upper cased version of genshellopt. */
2512b15cb3dSCy Schubert #define zPROGNAME       (genshellopt_opt_strs+1188)
2522b15cb3dSCy Schubert /** Reference to the title line for genshellopt usage. */
2532b15cb3dSCy Schubert #define zUsageTitle     (genshellopt_opt_strs+1200)
2542b15cb3dSCy Schubert /** There is no genshellopt configuration file. */
2552b15cb3dSCy Schubert #define zRcName         NULL
2562b15cb3dSCy Schubert /** There are no directories to search for genshellopt config files. */
2572b15cb3dSCy Schubert #define apzHomeList     NULL
2582b15cb3dSCy Schubert /** The genshellopt program bug email address. */
2592b15cb3dSCy Schubert #define zBugsAddr       (genshellopt_opt_strs+1321)
2602b15cb3dSCy Schubert /** Clarification/explanation of what genshellopt does. */
2612b15cb3dSCy Schubert #define zExplain        (genshellopt_opt_strs+1357)
2622b15cb3dSCy Schubert /** Extra detail explaining what genshellopt does. */
2632b15cb3dSCy Schubert #define zDetail         (genshellopt_opt_strs+1534)
2642b15cb3dSCy Schubert /** The full version string for genshellopt. */
2652b15cb3dSCy Schubert #define zFullVersion    (genshellopt_opt_strs+1755)
266*a466cc55SCy Schubert /* extracted from optcode.tlib near line 342 */
267ea906c41SOllivier Robert 
268ea906c41SOllivier Robert #if defined(ENABLE_NLS)
269ea906c41SOllivier Robert # define OPTPROC_BASE OPTPROC_TRANSLATE
270ea906c41SOllivier Robert   static tOptionXlateProc translate_option_strings;
271ea906c41SOllivier Robert #else
272ea906c41SOllivier Robert # define OPTPROC_BASE OPTPROC_NONE
273ea906c41SOllivier Robert # define translate_option_strings NULL
274ea906c41SOllivier Robert #endif /* ENABLE_NLS */
275ea906c41SOllivier Robert 
2762b15cb3dSCy Schubert #define genshellopt_full_usage (NULL)
2772b15cb3dSCy Schubert #define genshellopt_short_usage (NULL)
2782b15cb3dSCy Schubert 
2792b15cb3dSCy Schubert #endif /* not defined __doxygen__ */
2802b15cb3dSCy Schubert 
2812b15cb3dSCy Schubert /*
2822b15cb3dSCy Schubert  *  Create the static procedure(s) declared above.
2832b15cb3dSCy Schubert  */
2842b15cb3dSCy Schubert /**
2852b15cb3dSCy Schubert  * The callout function that invokes the genshelloptUsage function.
2862b15cb3dSCy Schubert  *
2872b15cb3dSCy Schubert  * @param[in] opts the AutoOpts option description structure
2882b15cb3dSCy Schubert  * @param[in] od   the descriptor for the "help" (usage) option.
2892b15cb3dSCy Schubert  * @noreturn
2902b15cb3dSCy Schubert  */
2912b15cb3dSCy Schubert static void
doUsageOpt(tOptions * opts,tOptDesc * od)2922b15cb3dSCy Schubert doUsageOpt(tOptions * opts, tOptDesc * od)
2932b15cb3dSCy Schubert {
2942b15cb3dSCy Schubert     int ex_code;
2952b15cb3dSCy Schubert     ex_code = GENSHELLOPT_EXIT_SUCCESS;
2962b15cb3dSCy Schubert     genshelloptUsage(&genshelloptOptions, ex_code);
2972b15cb3dSCy Schubert     /* NOTREACHED */
298*a466cc55SCy Schubert     exit(GENSHELLOPT_EXIT_FAILURE);
2992b15cb3dSCy Schubert     (void)opts;
3002b15cb3dSCy Schubert     (void)od;
3012b15cb3dSCy Schubert }
302276da39aSCy Schubert /* extracted from optmain.tlib near line 1250 */
3032b15cb3dSCy Schubert 
3042b15cb3dSCy Schubert /**
3052b15cb3dSCy Schubert  * The directory containing the data associated with genshellopt.
3062b15cb3dSCy Schubert  */
3072b15cb3dSCy Schubert #ifndef  PKGDATADIR
3082b15cb3dSCy Schubert # define PKGDATADIR ""
3092b15cb3dSCy Schubert #endif
3102b15cb3dSCy Schubert 
3112b15cb3dSCy Schubert /**
3122b15cb3dSCy Schubert  * Information about the person or institution that packaged genshellopt
3132b15cb3dSCy Schubert  * for the current distribution.
3142b15cb3dSCy Schubert  */
3152b15cb3dSCy Schubert #ifndef  WITH_PACKAGER
3162b15cb3dSCy Schubert # define genshellopt_packager_info NULL
3172b15cb3dSCy Schubert #else
3182b15cb3dSCy Schubert /** Packager information for genshellopt. */
3192b15cb3dSCy Schubert static char const genshellopt_packager_info[] =
3202b15cb3dSCy Schubert     "Packaged by " WITH_PACKAGER
3212b15cb3dSCy Schubert 
3222b15cb3dSCy Schubert # ifdef WITH_PACKAGER_VERSION
3232b15cb3dSCy Schubert         " ("WITH_PACKAGER_VERSION")"
3242b15cb3dSCy Schubert # endif
3252b15cb3dSCy Schubert 
3262b15cb3dSCy Schubert # ifdef WITH_PACKAGER_BUG_REPORTS
3272b15cb3dSCy Schubert     "\nReport genshellopt bugs to " WITH_PACKAGER_BUG_REPORTS
3282b15cb3dSCy Schubert # endif
3292b15cb3dSCy Schubert     "\n";
3302b15cb3dSCy Schubert #endif
3312b15cb3dSCy Schubert #ifndef __doxygen__
3322b15cb3dSCy Schubert 
3332b15cb3dSCy Schubert #endif /* __doxygen__ */
3342b15cb3dSCy Schubert /**
3352b15cb3dSCy Schubert  * The option definitions for genshellopt.  The one structure that
3362b15cb3dSCy Schubert  * binds them all.
3372b15cb3dSCy Schubert  */
338ea906c41SOllivier Robert tOptions genshelloptOptions = {
339ea906c41SOllivier Robert     OPTIONS_STRUCT_VERSION,
340ea906c41SOllivier Robert     0, NULL,                    /* original argc + argv    */
341ea906c41SOllivier Robert     ( OPTPROC_BASE
342ea906c41SOllivier Robert     + OPTPROC_ERRSTOP
343ea906c41SOllivier Robert     + OPTPROC_SHORTOPT
344ea906c41SOllivier Robert     + OPTPROC_LONGOPT
345ea906c41SOllivier Robert     + OPTPROC_NO_REQ_OPT
346ea906c41SOllivier Robert     + OPTPROC_NEGATIONS
347ea906c41SOllivier Robert     + OPTPROC_NO_ARGS ),
348ea906c41SOllivier Robert     0, NULL,                    /* current option index, current option */
349ea906c41SOllivier Robert     NULL,         NULL,         zPROGNAME,
3502b15cb3dSCy Schubert     zRcName,      zCopyright,   zLicenseDescrip,
351ea906c41SOllivier Robert     zFullVersion, apzHomeList,  zUsageTitle,
352ea906c41SOllivier Robert     zExplain,     zDetail,      optDesc,
353ea906c41SOllivier Robert     zBugsAddr,                  /* address to send bugs to */
354ea906c41SOllivier Robert     NULL, NULL,                 /* extensions/saved state  */
355ea906c41SOllivier Robert     genshelloptUsage, /* usage procedure */
356ea906c41SOllivier Robert     translate_option_strings,   /* translation procedure */
357ea906c41SOllivier Robert     /*
358ea906c41SOllivier Robert      *  Indexes to special options
359ea906c41SOllivier Robert      */
3602b15cb3dSCy Schubert     { INDEX_GENSHELL_OPT_MORE_HELP, /* more-help option index */
3612b15cb3dSCy Schubert       NO_EQUIVALENT, /* save option index */
3622b15cb3dSCy Schubert       NO_EQUIVALENT, /* '-#' option index */
363ea906c41SOllivier Robert       NO_EQUIVALENT /* index of default opt */
364ea906c41SOllivier Robert     },
3652b15cb3dSCy Schubert     5 /* full option count */, 2 /* user option count */,
3662b15cb3dSCy Schubert     genshellopt_full_usage, genshellopt_short_usage,
3672b15cb3dSCy Schubert     NULL, NULL,
3682b15cb3dSCy Schubert     PKGDATADIR, genshellopt_packager_info
369ea906c41SOllivier Robert };
370ea906c41SOllivier Robert 
371ea906c41SOllivier Robert #if ENABLE_NLS
3722b15cb3dSCy Schubert /**
3732b15cb3dSCy Schubert  * This code is designed to translate translatable option text for the
3742b15cb3dSCy Schubert  * genshellopt program.  These translations happen upon entry
3752b15cb3dSCy Schubert  * to optionProcess().
3762b15cb3dSCy Schubert  */
377ea906c41SOllivier Robert #include <stdio.h>
378ea906c41SOllivier Robert #include <stdlib.h>
379ea906c41SOllivier Robert #include <string.h>
380ea906c41SOllivier Robert #include <unistd.h>
3812b15cb3dSCy Schubert #ifdef HAVE_DCGETTEXT
3822b15cb3dSCy Schubert # include <gettext.h>
3832b15cb3dSCy Schubert #endif
384ea906c41SOllivier Robert #include <autoopts/usage-txt.h>
385ea906c41SOllivier Robert 
386ea906c41SOllivier Robert static char * AO_gettext(char const * pz);
387ea906c41SOllivier Robert static void   coerce_it(void ** s);
388ea906c41SOllivier Robert 
3892b15cb3dSCy Schubert /**
3902b15cb3dSCy Schubert  * AutoGen specific wrapper function for gettext.  It relies on the macro _()
3912b15cb3dSCy Schubert  * to convert from English to the target language, then strdup-duplicates the
3922b15cb3dSCy Schubert  * result string.  It tries the "libopts" domain first, then whatever has been
3932b15cb3dSCy Schubert  * set via the \a textdomain(3) call.
3942b15cb3dSCy Schubert  *
3952b15cb3dSCy Schubert  * @param[in] pz the input text used as a lookup key.
3962b15cb3dSCy Schubert  * @returns the translated text (if there is one),
3972b15cb3dSCy Schubert  *   or the original text (if not).
3982b15cb3dSCy Schubert  */
399ea906c41SOllivier Robert static char *
AO_gettext(char const * pz)400ea906c41SOllivier Robert AO_gettext(char const * pz)
401ea906c41SOllivier Robert {
4022b15cb3dSCy Schubert     char * res;
403ea906c41SOllivier Robert     if (pz == NULL)
404ea906c41SOllivier Robert         return NULL;
4052b15cb3dSCy Schubert #ifdef HAVE_DCGETTEXT
406ea906c41SOllivier Robert     /*
4072b15cb3dSCy Schubert      * While processing the option_xlateable_txt data, try to use the
4082b15cb3dSCy Schubert      * "libopts" domain.  Once we switch to the option descriptor data,
4092b15cb3dSCy Schubert      * do *not* use that domain.
4102b15cb3dSCy Schubert      */
4112b15cb3dSCy Schubert     if (option_xlateable_txt.field_ct != 0) {
4122b15cb3dSCy Schubert         res = dgettext("libopts", pz);
4132b15cb3dSCy Schubert         if (res == pz)
414276da39aSCy Schubert             res = (char *)VOIDP(_(pz));
4152b15cb3dSCy Schubert     } else
416276da39aSCy Schubert         res = (char *)VOIDP(_(pz));
4172b15cb3dSCy Schubert #else
418276da39aSCy Schubert     res = (char *)VOIDP(_(pz));
4192b15cb3dSCy Schubert #endif
4202b15cb3dSCy Schubert     if (res == pz)
4212b15cb3dSCy Schubert         return res;
4222b15cb3dSCy Schubert     res = strdup(res);
4232b15cb3dSCy Schubert     if (res == NULL) {
4242b15cb3dSCy Schubert         fputs(_("No memory for duping translated strings\n"), stderr);
4252b15cb3dSCy Schubert         exit(GENSHELLOPT_EXIT_FAILURE);
4262b15cb3dSCy Schubert     }
4272b15cb3dSCy Schubert     return res;
4282b15cb3dSCy Schubert }
4292b15cb3dSCy Schubert 
4302b15cb3dSCy Schubert /**
4312b15cb3dSCy Schubert  * All the pointers we use are marked "* const", but they are stored in
4322b15cb3dSCy Schubert  * writable memory.  Coerce the mutability and set the pointer.
4332b15cb3dSCy Schubert  */
coerce_it(void ** s)4342b15cb3dSCy Schubert static void coerce_it(void ** s) { *s = AO_gettext(*s);
4352b15cb3dSCy Schubert }
4362b15cb3dSCy Schubert 
4372b15cb3dSCy Schubert /**
4382b15cb3dSCy Schubert  * Translate all the translatable strings in the genshelloptOptions
4392b15cb3dSCy Schubert  * structure defined above.  This is done only once.
440ea906c41SOllivier Robert  */
441ea906c41SOllivier Robert static void
translate_option_strings(void)442ea906c41SOllivier Robert translate_option_strings(void)
443ea906c41SOllivier Robert {
4442b15cb3dSCy Schubert     tOptions * const opts = &genshelloptOptions;
4452b15cb3dSCy Schubert 
446ea906c41SOllivier Robert     /*
447ea906c41SOllivier Robert      *  Guard against re-translation.  It won't work.  The strings will have
448ea906c41SOllivier Robert      *  been changed by the first pass through this code.  One shot only.
449ea906c41SOllivier Robert      */
4502b15cb3dSCy Schubert     if (option_xlateable_txt.field_ct != 0) {
451ea906c41SOllivier Robert         /*
4522b15cb3dSCy Schubert          *  Do the translations.  The first pointer follows the field count
4532b15cb3dSCy Schubert          *  field.  The field count field is the size of a pointer.
454ea906c41SOllivier Robert          */
455276da39aSCy Schubert         char ** ppz = (char**)VOIDP(&(option_xlateable_txt));
4562b15cb3dSCy Schubert         int     ix  = option_xlateable_txt.field_ct;
457ea906c41SOllivier Robert 
458ea906c41SOllivier Robert         do {
4592b15cb3dSCy Schubert             ppz++; /* skip over field_ct */
460ea906c41SOllivier Robert             *ppz = AO_gettext(*ppz);
461ea906c41SOllivier Robert         } while (--ix > 0);
4622b15cb3dSCy Schubert         /* prevent re-translation and disable "libopts" domain lookup */
4632b15cb3dSCy Schubert         option_xlateable_txt.field_ct = 0;
464ea906c41SOllivier Robert 
465276da39aSCy Schubert         coerce_it(VOIDP(&(opts->pzCopyright)));
466276da39aSCy Schubert         coerce_it(VOIDP(&(opts->pzCopyNotice)));
467276da39aSCy Schubert         coerce_it(VOIDP(&(opts->pzFullVersion)));
468276da39aSCy Schubert         coerce_it(VOIDP(&(opts->pzUsageTitle)));
469276da39aSCy Schubert         coerce_it(VOIDP(&(opts->pzExplain)));
470276da39aSCy Schubert         coerce_it(VOIDP(&(opts->pzDetail)));
471ea906c41SOllivier Robert         {
4722b15cb3dSCy Schubert             tOptDesc * od = opts->pOptDesc;
4732b15cb3dSCy Schubert             for (ix = opts->optCt; ix > 0; ix--, od++)
474276da39aSCy Schubert                 coerce_it(VOIDP(&(od->pzText)));
475ea906c41SOllivier Robert         }
476ea906c41SOllivier Robert     }
477ea906c41SOllivier Robert }
478ea906c41SOllivier Robert #endif /* ENABLE_NLS */
479ea906c41SOllivier Robert 
4802b15cb3dSCy Schubert #ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
4812b15cb3dSCy Schubert /** I18N function strictly for xgettext.  Do not compile. */
bogus_function(void)4822b15cb3dSCy Schubert static void bogus_function(void) {
4832b15cb3dSCy Schubert   /* TRANSLATORS:
4842b15cb3dSCy Schubert 
4852b15cb3dSCy Schubert      The following dummy function was crated solely so that xgettext can
4862b15cb3dSCy Schubert      extract the correct strings.  These strings are actually referenced
4872b15cb3dSCy Schubert      by a field name in the genshelloptOptions structure noted in the
4882b15cb3dSCy Schubert      comments below.  The literal text is defined in genshellopt_opt_strs.
4892b15cb3dSCy Schubert 
4902b15cb3dSCy Schubert      NOTE: the strings below are segmented with respect to the source string
4912b15cb3dSCy Schubert      genshellopt_opt_strs.  The strings above are handed off for translation
4922b15cb3dSCy Schubert      at run time a paragraph at a time.  Consequently, they are presented here
4932b15cb3dSCy Schubert      for translation a paragraph at a time.
4942b15cb3dSCy Schubert 
4952b15cb3dSCy Schubert      ALSO: often the description for an option will reference another option
4962b15cb3dSCy Schubert      by name.  These are set off with apostrophe quotes (I hope).  Do not
4972b15cb3dSCy Schubert      translate option names.
4982b15cb3dSCy Schubert    */
4992b15cb3dSCy Schubert   /* referenced via genshelloptOptions.pzCopyright */
5002b15cb3dSCy Schubert   puts(_("genshellopt 1\n\
501*a466cc55SCy Schubert Copyright (C) 1999-2018 Bruce Korb, all rights reserved.\n\
5022b15cb3dSCy Schubert This is free software. It is licensed for use, modification and\n\
5032b15cb3dSCy Schubert redistribution under the terms of the GNU Lesser General Public License,\n\
5042b15cb3dSCy Schubert version 2 or later <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>\n"));
5052b15cb3dSCy Schubert 
5062b15cb3dSCy Schubert   /* referenced via genshelloptOptions.pzCopyNotice */
5072b15cb3dSCy Schubert   puts(_("The genshellopt library is free software; you can redistribute it and/or\n\
5082b15cb3dSCy Schubert modify it under the terms of the GNU Library General Public License as\n\
5092b15cb3dSCy Schubert published by the Free Software Foundation; either version 2 of the License,\n\
5102b15cb3dSCy Schubert or (at your option) any later version.\n\n"));
5112b15cb3dSCy Schubert   puts(_("This library is distributed in the hope that it will be useful, but WITHOUT\n\
5122b15cb3dSCy Schubert ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n\
5132b15cb3dSCy Schubert FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public\n\
5142b15cb3dSCy Schubert License for more details.\n\n"));
5152b15cb3dSCy Schubert   puts(_("You should have received a copy of the GNU Library General Public License\n\
5162b15cb3dSCy Schubert along with this library; if not, see\n\
5172b15cb3dSCy Schubert <http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>\n"));
5182b15cb3dSCy Schubert 
5192b15cb3dSCy Schubert   /* referenced via genshelloptOptions.pOptDesc->pzText */
5202b15cb3dSCy Schubert   puts(_("Output Script File"));
5212b15cb3dSCy Schubert 
5222b15cb3dSCy Schubert   /* referenced via genshelloptOptions.pOptDesc->pzText */
5232b15cb3dSCy Schubert   puts(_("Shell name (follows \"#!\" magic)"));
5242b15cb3dSCy Schubert 
5252b15cb3dSCy Schubert   /* referenced via genshelloptOptions.pOptDesc->pzText */
5262b15cb3dSCy Schubert   puts(_("display extended usage information and exit"));
5272b15cb3dSCy Schubert 
5282b15cb3dSCy Schubert   /* referenced via genshelloptOptions.pOptDesc->pzText */
5292b15cb3dSCy Schubert   puts(_("extended usage information passed thru pager"));
5302b15cb3dSCy Schubert 
5312b15cb3dSCy Schubert   /* referenced via genshelloptOptions.pOptDesc->pzText */
5322b15cb3dSCy Schubert   puts(_("output version information and exit"));
5332b15cb3dSCy Schubert 
5342b15cb3dSCy Schubert   /* referenced via genshelloptOptions.pzUsageTitle */
5352b15cb3dSCy Schubert   puts(_("genshellopt - Generate Shell Option Processing Script - Ver. 1\n\
5362b15cb3dSCy Schubert Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
5372b15cb3dSCy Schubert 
5382b15cb3dSCy Schubert   /* referenced via genshelloptOptions.pzExplain */
5392b15cb3dSCy Schubert   puts(_("Note that 'shell' is only useful if the output file does not already exist.\n\
5402b15cb3dSCy Schubert If it does, then the shell name and optional first argument will be\n\
5412b15cb3dSCy Schubert extracted from the script file.\n"));
5422b15cb3dSCy Schubert 
5432b15cb3dSCy Schubert   /* referenced via genshelloptOptions.pzDetail */
5442b15cb3dSCy Schubert   puts(_("If the script file already exists and contains Automated Option Processing\n\
5452b15cb3dSCy Schubert text, the second line of the file through the ending tag will be replaced\n\
5462b15cb3dSCy Schubert by the newly generated text.  The first '#!' line will be regenerated.\n"));
5472b15cb3dSCy Schubert 
5482b15cb3dSCy Schubert   /* referenced via genshelloptOptions.pzFullVersion */
5492b15cb3dSCy Schubert   puts(_("genshellopt 1"));
5502b15cb3dSCy Schubert 
5512b15cb3dSCy Schubert   /* referenced via genshelloptOptions.pzFullUsage */
5522b15cb3dSCy Schubert   puts(_("<<<NOT-FOUND>>>"));
5532b15cb3dSCy Schubert 
5542b15cb3dSCy Schubert   /* referenced via genshelloptOptions.pzShortUsage */
5552b15cb3dSCy Schubert   puts(_("<<<NOT-FOUND>>>"));
5562b15cb3dSCy Schubert   /* LIBOPTS-MESSAGES: */
5572b15cb3dSCy Schubert #line 67 "../autoopts.c"
5582b15cb3dSCy Schubert   puts(_("allocation of %d bytes failed\n"));
559*a466cc55SCy Schubert #line 89 "../autoopts.c"
5602b15cb3dSCy Schubert   puts(_("allocation of %d bytes failed\n"));
561*a466cc55SCy Schubert #line 48 "../init.c"
5622b15cb3dSCy Schubert   puts(_("AutoOpts function called without option descriptor\n"));
563*a466cc55SCy Schubert #line 81 "../init.c"
5642b15cb3dSCy Schubert   puts(_("\tThis exceeds the compiled library version:  "));
565*a466cc55SCy Schubert #line 79 "../init.c"
5662b15cb3dSCy Schubert   puts(_("Automated Options Processing Error!\n"
5672b15cb3dSCy Schubert        "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
568*a466cc55SCy Schubert #line 78 "../autoopts.c"
5692b15cb3dSCy Schubert   puts(_("realloc of %d bytes at 0x%p failed\n"));
570*a466cc55SCy Schubert #line 83 "../init.c"
5712b15cb3dSCy Schubert   puts(_("\tThis is less than the minimum library version:  "));
5722b15cb3dSCy Schubert #line 121 "../version.c"
5732b15cb3dSCy Schubert   puts(_("Automated Options version %s\n"
574*a466cc55SCy Schubert        "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
575*a466cc55SCy Schubert #line 49 "../makeshell.c"
5762b15cb3dSCy Schubert   puts(_("(AutoOpts bug):  %s.\n"));
5772b15cb3dSCy Schubert #line 90 "../reset.c"
5782b15cb3dSCy Schubert   puts(_("optionResetOpt() called, but reset-option not configured"));
579*a466cc55SCy Schubert #line 241 "../usage.c"
5802b15cb3dSCy Schubert   puts(_("could not locate the 'help' option"));
581*a466cc55SCy Schubert #line 330 "../autoopts.c"
5822b15cb3dSCy Schubert   puts(_("optionProcess() was called with invalid data"));
583*a466cc55SCy Schubert #line 697 "../usage.c"
5842b15cb3dSCy Schubert   puts(_("invalid argument type specified"));
585*a466cc55SCy Schubert #line 568 "../find.c"
5862b15cb3dSCy Schubert   puts(_("defaulted to option with optional arg"));
5872b15cb3dSCy Schubert #line 76 "../alias.c"
5882b15cb3dSCy Schubert   puts(_("aliasing option is out of range."));
589*a466cc55SCy Schubert #line 210 "../enum.c"
5902b15cb3dSCy Schubert   puts(_("%s error:  the keyword '%s' is ambiguous for %s\n"));
591*a466cc55SCy Schubert #line 78 "../find.c"
5922b15cb3dSCy Schubert   puts(_("  The following options match:\n"));
593*a466cc55SCy Schubert #line 263 "../find.c"
5942b15cb3dSCy Schubert   puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
5952b15cb3dSCy Schubert #line 161 "../check.c"
5962b15cb3dSCy Schubert   puts(_("%s: Command line arguments required\n"));
5972b15cb3dSCy Schubert #line 43 "../alias.c"
5982b15cb3dSCy Schubert   puts(_("%d %s%s options allowed\n"));
599*a466cc55SCy Schubert #line 56 "../makeshell.c"
6002b15cb3dSCy Schubert   puts(_("%s error %d (%s) calling %s for '%s'\n"));
601*a466cc55SCy Schubert #line 268 "../makeshell.c"
6022b15cb3dSCy Schubert   puts(_("interprocess pipe"));
603*a466cc55SCy Schubert #line 171 "../version.c"
6042b15cb3dSCy Schubert   puts(_("error: version option argument '%c' invalid.  Use:\n"
6052b15cb3dSCy Schubert        "\t'v' - version only\n"
6062b15cb3dSCy Schubert        "\t'c' - version and copyright\n"
6072b15cb3dSCy Schubert        "\t'n' - version and full copyright notice\n"));
6082b15cb3dSCy Schubert #line 58 "../check.c"
6092b15cb3dSCy Schubert   puts(_("%s error:  the '%s' and '%s' options conflict\n"));
610*a466cc55SCy Schubert #line 187 "../find.c"
6112b15cb3dSCy Schubert   puts(_("%s: The '%s' option has been disabled."));
612*a466cc55SCy Schubert #line 400 "../find.c"
6132b15cb3dSCy Schubert   puts(_("%s: The '%s' option has been disabled."));
6142b15cb3dSCy Schubert #line 38 "../alias.c"
6152b15cb3dSCy Schubert   puts(_("-equivalence"));
616*a466cc55SCy Schubert #line 439 "../find.c"
6172b15cb3dSCy Schubert   puts(_("%s: illegal option -- %c\n"));
6182b15cb3dSCy Schubert #line 110 "../reset.c"
6192b15cb3dSCy Schubert   puts(_("%s: illegal option -- %c\n"));
620*a466cc55SCy Schubert #line 241 "../find.c"
6212b15cb3dSCy Schubert   puts(_("%s: illegal option -- %s\n"));
622*a466cc55SCy Schubert #line 740 "../find.c"
6232b15cb3dSCy Schubert   puts(_("%s: illegal option -- %s\n"));
6242b15cb3dSCy Schubert #line 118 "../reset.c"
6252b15cb3dSCy Schubert   puts(_("%s: illegal option -- %s\n"));
626*a466cc55SCy Schubert #line 305 "../find.c"
6272b15cb3dSCy Schubert   puts(_("%s: unknown vendor extension option -- %s\n"));
628*a466cc55SCy Schubert #line 135 "../enum.c"
6292b15cb3dSCy Schubert   puts(_("  or an integer from %d through %d\n"));
630*a466cc55SCy Schubert #line 145 "../enum.c"
6312b15cb3dSCy Schubert   puts(_("  or an integer from %d through %d\n"));
632*a466cc55SCy Schubert #line 696 "../usage.c"
6332b15cb3dSCy Schubert   puts(_("%s error:  invalid option descriptor for %s\n"));
634*a466cc55SCy Schubert #line 1030 "../usage.c"
6352b15cb3dSCy Schubert   puts(_("%s error:  invalid option descriptor for %s\n"));
636*a466cc55SCy Schubert #line 355 "../find.c"
6372b15cb3dSCy Schubert   puts(_("%s: invalid option name: %s\n"));
638*a466cc55SCy Schubert #line 497 "../find.c"
6392b15cb3dSCy Schubert   puts(_("%s: The '%s' option requires an argument.\n"));
640*a466cc55SCy Schubert #line 150 "../autoopts.c"
6412b15cb3dSCy Schubert   puts(_("(AutoOpts bug):  Equivalenced option '%s' was equivalenced to both\n"
6422b15cb3dSCy Schubert        "\t'%s' and '%s'."));
6432b15cb3dSCy Schubert #line 94 "../check.c"
6442b15cb3dSCy Schubert   puts(_("%s error:  The %s option is required\n"));
645*a466cc55SCy Schubert #line 602 "../find.c"
6462b15cb3dSCy Schubert   puts(_("%s: The '%s' option cannot have an argument.\n"));
6472b15cb3dSCy Schubert #line 151 "../check.c"
6482b15cb3dSCy Schubert   puts(_("%s: Command line arguments are not allowed.\n"));
649*a466cc55SCy Schubert #line 568 "../save.c"
6502b15cb3dSCy Schubert   puts(_("error %d (%s) creating %s\n"));
651*a466cc55SCy Schubert #line 210 "../enum.c"
6522b15cb3dSCy Schubert   puts(_("%s error:  '%s' does not match any %s keywords.\n"));
6532b15cb3dSCy Schubert #line 93 "../reset.c"
6542b15cb3dSCy Schubert   puts(_("%s error: The '%s' option requires an argument.\n"));
655*a466cc55SCy Schubert #line 122 "../save.c"
6562b15cb3dSCy Schubert   puts(_("error %d (%s) stat-ing %s\n"));
657*a466cc55SCy Schubert #line 175 "../save.c"
6582b15cb3dSCy Schubert   puts(_("error %d (%s) stat-ing %s\n"));
6592b15cb3dSCy Schubert #line 143 "../restore.c"
6602b15cb3dSCy Schubert   puts(_("%s error: no saved option state\n"));
661*a466cc55SCy Schubert #line 225 "../autoopts.c"
6622b15cb3dSCy Schubert   puts(_("'%s' is not a command line option.\n"));
663*a466cc55SCy Schubert #line 113 "../time.c"
6642b15cb3dSCy Schubert   puts(_("%s error:  '%s' is not a recognizable date/time.\n"));
6652b15cb3dSCy Schubert #line 50 "../time.c"
6662b15cb3dSCy Schubert   puts(_("%s error:  '%s' is not a recognizable time duration.\n"));
6672b15cb3dSCy Schubert #line 92 "../check.c"
6682b15cb3dSCy Schubert   puts(_("%s error:  The %s option must appear %d times.\n"));
669*a466cc55SCy Schubert #line 165 "../numeric.c"
6702b15cb3dSCy Schubert   puts(_("%s error:  '%s' is not a recognizable number.\n"));
671*a466cc55SCy Schubert #line 176 "../enum.c"
6722b15cb3dSCy Schubert   puts(_("%s error:  %s exceeds %s keyword count\n"));
673*a466cc55SCy Schubert #line 279 "../usage.c"
6742b15cb3dSCy Schubert   puts(_("Try '%s %s' for more information.\n"));
6752b15cb3dSCy Schubert #line 45 "../alias.c"
6762b15cb3dSCy Schubert   puts(_("one %s%s option allowed\n"));
677*a466cc55SCy Schubert #line 170 "../makeshell.c"
6782b15cb3dSCy Schubert   puts(_("standard output"));
679*a466cc55SCy Schubert #line 905 "../makeshell.c"
6802b15cb3dSCy Schubert   puts(_("standard output"));
681*a466cc55SCy Schubert #line 223 "../usage.c"
6822b15cb3dSCy Schubert   puts(_("standard output"));
683*a466cc55SCy Schubert #line 364 "../usage.c"
6842b15cb3dSCy Schubert   puts(_("standard output"));
685*a466cc55SCy Schubert #line 574 "../usage.c"
6862b15cb3dSCy Schubert   puts(_("standard output"));
687*a466cc55SCy Schubert #line 178 "../version.c"
6882b15cb3dSCy Schubert   puts(_("standard output"));
689*a466cc55SCy Schubert #line 223 "../usage.c"
6902b15cb3dSCy Schubert   puts(_("standard error"));
691*a466cc55SCy Schubert #line 364 "../usage.c"
6922b15cb3dSCy Schubert   puts(_("standard error"));
693*a466cc55SCy Schubert #line 574 "../usage.c"
6942b15cb3dSCy Schubert   puts(_("standard error"));
695*a466cc55SCy Schubert #line 178 "../version.c"
6962b15cb3dSCy Schubert   puts(_("standard error"));
697*a466cc55SCy Schubert #line 170 "../makeshell.c"
6982b15cb3dSCy Schubert   puts(_("write"));
699*a466cc55SCy Schubert #line 905 "../makeshell.c"
7002b15cb3dSCy Schubert   puts(_("write"));
701*a466cc55SCy Schubert #line 222 "../usage.c"
7022b15cb3dSCy Schubert   puts(_("write"));
703*a466cc55SCy Schubert #line 363 "../usage.c"
7042b15cb3dSCy Schubert   puts(_("write"));
705*a466cc55SCy Schubert #line 573 "../usage.c"
7062b15cb3dSCy Schubert   puts(_("write"));
707*a466cc55SCy Schubert #line 177 "../version.c"
7082b15cb3dSCy Schubert   puts(_("write"));
7092b15cb3dSCy Schubert #line 60 "../numeric.c"
7102b15cb3dSCy Schubert   puts(_("%s error:  %s option value %ld is out of range.\n"));
7112b15cb3dSCy Schubert #line 44 "../check.c"
7122b15cb3dSCy Schubert   puts(_("%s error:  %s option requires the %s option\n"));
713*a466cc55SCy Schubert #line 121 "../save.c"
7142b15cb3dSCy Schubert   puts(_("%s warning:  cannot save options - %s not regular file\n"));
715*a466cc55SCy Schubert #line 174 "../save.c"
7162b15cb3dSCy Schubert   puts(_("%s warning:  cannot save options - %s not regular file\n"));
717*a466cc55SCy Schubert #line 193 "../save.c"
7182b15cb3dSCy Schubert   puts(_("%s warning:  cannot save options - %s not regular file\n"));
719*a466cc55SCy Schubert #line 567 "../save.c"
7202b15cb3dSCy Schubert   puts(_("%s warning:  cannot save options - %s not regular file\n"));
7212b15cb3dSCy Schubert   /* END-LIBOPTS-MESSAGES */
7222b15cb3dSCy Schubert 
7232b15cb3dSCy Schubert   /* USAGE-TEXT: */
724*a466cc55SCy Schubert #line 822 "../usage.c"
7252b15cb3dSCy Schubert   puts(_("\t\t\t\t- an alternate for '%s'\n"));
726*a466cc55SCy Schubert #line 1097 "../usage.c"
7272b15cb3dSCy Schubert   puts(_("Version, usage and configuration options:"));
728*a466cc55SCy Schubert #line 873 "../usage.c"
7292b15cb3dSCy Schubert   puts(_("\t\t\t\t- default option for unnamed options\n"));
730*a466cc55SCy Schubert #line 786 "../usage.c"
7312b15cb3dSCy Schubert   puts(_("\t\t\t\t- disabled as '--%s'\n"));
732*a466cc55SCy Schubert #line 1066 "../usage.c"
7332b15cb3dSCy Schubert   puts(_(" --- %-14s %s\n"));
734*a466cc55SCy Schubert #line 1064 "../usage.c"
7352b15cb3dSCy Schubert   puts(_("This option has been disabled"));
736*a466cc55SCy Schubert #line 813 "../usage.c"
7372b15cb3dSCy Schubert   puts(_("\t\t\t\t- enabled by default\n"));
7382b15cb3dSCy Schubert #line 40 "../alias.c"
7392b15cb3dSCy Schubert   puts(_("%s error:  only "));
740*a466cc55SCy Schubert #line 1143 "../usage.c"
7412b15cb3dSCy Schubert   puts(_(" - examining environment variables named %s_*\n"));
7422b15cb3dSCy Schubert #line 168 "../file.c"
7432b15cb3dSCy Schubert   puts(_("\t\t\t\t- file must not pre-exist\n"));
7442b15cb3dSCy Schubert #line 172 "../file.c"
7452b15cb3dSCy Schubert   puts(_("\t\t\t\t- file must pre-exist\n"));
746*a466cc55SCy Schubert #line 329 "../usage.c"
7472b15cb3dSCy Schubert   puts(_("Options are specified by doubled hyphens and their name or by a single\n"
7482b15cb3dSCy Schubert        "hyphen and the flag character.\n"));
749*a466cc55SCy Schubert #line 882 "../makeshell.c"
7502b15cb3dSCy Schubert   puts(_("\n"
7512b15cb3dSCy Schubert        "= = = = = = = =\n\n"
7522b15cb3dSCy Schubert        "This incarnation of genshell will produce\n"
7532b15cb3dSCy Schubert        "a shell script to parse the options for %s:\n\n"));
754*a466cc55SCy Schubert #line 142 "../enum.c"
7552b15cb3dSCy Schubert   puts(_("  or an integer mask with any of the lower %d bits set\n"));
756*a466cc55SCy Schubert #line 846 "../usage.c"
7572b15cb3dSCy Schubert   puts(_("\t\t\t\t- is a set membership option\n"));
758*a466cc55SCy Schubert #line 867 "../usage.c"
7592b15cb3dSCy Schubert   puts(_("\t\t\t\t- must appear between %d and %d times\n"));
760*a466cc55SCy Schubert #line 331 "../usage.c"
7612b15cb3dSCy Schubert   puts(_("Options are specified by single or double hyphens and their name.\n"));
762*a466cc55SCy Schubert #line 853 "../usage.c"
7632b15cb3dSCy Schubert   puts(_("\t\t\t\t- may appear multiple times\n"));
764*a466cc55SCy Schubert #line 840 "../usage.c"
7652b15cb3dSCy Schubert   puts(_("\t\t\t\t- may not be preset\n"));
766*a466cc55SCy Schubert #line 1258 "../usage.c"
7672b15cb3dSCy Schubert   puts(_("   Arg Option-Name    Description\n"));
768*a466cc55SCy Schubert #line 1194 "../usage.c"
7692b15cb3dSCy Schubert   puts(_("  Flg Arg Option-Name    Description\n"));
770*a466cc55SCy Schubert #line 1252 "../usage.c"
7712b15cb3dSCy Schubert   puts(_("  Flg Arg Option-Name    Description\n"));
772*a466cc55SCy Schubert #line 1253 "../usage.c"
7732b15cb3dSCy Schubert   puts(_(" %3s %s"));
774*a466cc55SCy Schubert #line 1259 "../usage.c"
7752b15cb3dSCy Schubert   puts(_(" %3s %s"));
776*a466cc55SCy Schubert #line 336 "../usage.c"
7772b15cb3dSCy Schubert   puts(_("The '-#<number>' option may omit the hash char\n"));
778*a466cc55SCy Schubert #line 332 "../usage.c"
7792b15cb3dSCy Schubert   puts(_("All arguments are named options.\n"));
780*a466cc55SCy Schubert #line 920 "../usage.c"
7812b15cb3dSCy Schubert   puts(_(" - reading file %s"));
782*a466cc55SCy Schubert #line 358 "../usage.c"
7832b15cb3dSCy Schubert   puts(_("\n"
7842b15cb3dSCy Schubert        "Please send bug reports to:  <%s>\n"));
7852b15cb3dSCy Schubert #line 100 "../version.c"
7862b15cb3dSCy Schubert   puts(_("\n"
7872b15cb3dSCy Schubert        "Please send bug reports to:  <%s>\n"));
7882b15cb3dSCy Schubert #line 129 "../version.c"
7892b15cb3dSCy Schubert   puts(_("\n"
7902b15cb3dSCy Schubert        "Please send bug reports to:  <%s>\n"));
791*a466cc55SCy Schubert #line 852 "../usage.c"
7922b15cb3dSCy Schubert   puts(_("\t\t\t\t- may NOT appear - preset only\n"));
793*a466cc55SCy Schubert #line 893 "../usage.c"
7942b15cb3dSCy Schubert   puts(_("\n"
7952b15cb3dSCy Schubert        "The following option preset mechanisms are supported:\n"));
796*a466cc55SCy Schubert #line 1141 "../usage.c"
7972b15cb3dSCy Schubert   puts(_("\n"
7982b15cb3dSCy Schubert        "The following option preset mechanisms are supported:\n"));
799*a466cc55SCy Schubert #line 631 "../usage.c"
8002b15cb3dSCy Schubert   puts(_("prohibits these options:\n"));
801*a466cc55SCy Schubert #line 626 "../usage.c"
8022b15cb3dSCy Schubert   puts(_("prohibits the option '%s'\n"));
8032b15cb3dSCy Schubert #line 81 "../numeric.c"
8042b15cb3dSCy Schubert   puts(_("%s%ld to %ld"));
8052b15cb3dSCy Schubert #line 79 "../numeric.c"
8062b15cb3dSCy Schubert   puts(_("%sgreater than or equal to %ld"));
8072b15cb3dSCy Schubert #line 75 "../numeric.c"
8082b15cb3dSCy Schubert   puts(_("%s%ld exactly"));
8092b15cb3dSCy Schubert #line 68 "../numeric.c"
8102b15cb3dSCy Schubert   puts(_("%sit must lie in one of the ranges:\n"));
8112b15cb3dSCy Schubert #line 68 "../numeric.c"
8122b15cb3dSCy Schubert   puts(_("%sit must be in the range:\n"));
8132b15cb3dSCy Schubert #line 88 "../numeric.c"
8142b15cb3dSCy Schubert   puts(_(", or\n"));
8152b15cb3dSCy Schubert #line 66 "../numeric.c"
8162b15cb3dSCy Schubert   puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
8172b15cb3dSCy Schubert #line 77 "../numeric.c"
8182b15cb3dSCy Schubert   puts(_("%sless than or equal to %ld"));
819*a466cc55SCy Schubert #line 339 "../usage.c"
8202b15cb3dSCy Schubert   puts(_("Operands and options may be intermixed.  They will be reordered.\n"));
821*a466cc55SCy Schubert #line 601 "../usage.c"
8222b15cb3dSCy Schubert   puts(_("requires the option '%s'\n"));
823*a466cc55SCy Schubert #line 604 "../usage.c"
8242b15cb3dSCy Schubert   puts(_("requires these options:\n"));
825*a466cc55SCy Schubert #line 1270 "../usage.c"
8262b15cb3dSCy Schubert   puts(_("   Arg Option-Name   Req?  Description\n"));
827*a466cc55SCy Schubert #line 1264 "../usage.c"
8282b15cb3dSCy Schubert   puts(_("  Flg Arg Option-Name   Req?  Description\n"));
829*a466cc55SCy Schubert #line 143 "../enum.c"
8302b15cb3dSCy Schubert   puts(_("or you may use a numeric representation.  Preceding these with a '!'\n"
8312b15cb3dSCy Schubert        "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
8322b15cb3dSCy Schubert        "will set them all.  Multiple entries may be passed as an option\n"
8332b15cb3dSCy Schubert        "argument list.\n"));
834*a466cc55SCy Schubert #line 859 "../usage.c"
8352b15cb3dSCy Schubert   puts(_("\t\t\t\t- may appear up to %d times\n"));
836*a466cc55SCy Schubert #line 52 "../enum.c"
8372b15cb3dSCy Schubert   puts(_("The valid \"%s\" option keywords are:\n"));
838*a466cc55SCy Schubert #line 1101 "../usage.c"
8392b15cb3dSCy Schubert   puts(_("The next option supports vendor supported extra options:"));
840*a466cc55SCy Schubert #line 722 "../usage.c"
8412b15cb3dSCy Schubert   puts(_("These additional options are:"));
8422b15cb3dSCy Schubert   /* END-USAGE-TEXT */
8432b15cb3dSCy Schubert }
8442b15cb3dSCy Schubert #endif /* uncompilable code */
845ea906c41SOllivier Robert #ifdef  __cplusplus
846ea906c41SOllivier Robert }
847ea906c41SOllivier Robert #endif
848ea906c41SOllivier Robert /* genshell.c ends here */
849