genshell.c 31 KB

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