genshell.c 31 KB

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