42#define OPTION_CODE_COMPILE 1
59#define zCopyright (rsstats_opt_strs+0)
60#define zLicenseDescrip (rsstats_opt_strs+258)
70static char const rsstats_opt_strs[1873] =
72 "Copyright (C) 2024 Francois Cerbelle, all rights reserved.\n"
73 "This is free software. It is licensed for use, modification and\n"
74 "redistribution under the terms of the GNU General Public License,\n"
75 "version 3 or later <http://gnu.org/licenses/gpl.html>\n\0"
76 "rsstats is free software: you can redistribute it and/or modify it under\n"
77 "the terms of the GNU General Public License as published by the Free\n"
78 "Software Foundation, either version 3 of the License, or (at your option)\n"
79 "any later version.\n\n"
80 "rsstats is distributed in the hope that it will be useful, but WITHOUT ANY\n"
81 "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n"
82 "FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\n"
84 "You should have received a copy of the GNU General Public License along\n"
85 "with this program. If not, see <http://www.gnu.org/licenses/>.\n\0"
86 "input CSV file (default: clusterdef.csv)\0"
90 "output CVS filename for nodes information (default: rsstats.csv)\0"
94 "comma separated list of clusternames to query (default: all)\0"
98 "Comma separated list of reports to generate (default: all)\0"
101 "display extended usage information and exit\0"
103 "extended usage information passed thru pager\0"
105 "output version information and exit\0"
107 "save the option state to a config file\0"
109 "load options from a config file\0"
114 "rsstats - Redis Enterprise Software cluster statistic extraction\n"
115 "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
118 "francois@cerbelle.net\0"
119 "additional information given whenever the usage routine is invoked.\n\0"
120 "This string is added to the usage output when the HELP option is selected.\n"
121 "The contents of the file 'rsstats.details' is added to the usage output\n"
122 "when the MORE-HELP option is selected.\n\0"
129#define INPUT_DESC (rsstats_opt_strs+861)
131#define INPUT_NAME (rsstats_opt_strs+902)
133#define INPUT_name (rsstats_opt_strs+908)
135#define INPUT_DFT_ARG (rsstats_opt_strs+914)
137#define INPUT_FLAGS (OPTST_DISABLED \
138 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
144#define OUTPUT_DESC (rsstats_opt_strs+929)
146#define OUTPUT_NAME (rsstats_opt_strs+994)
148#define OUTPUT_name (rsstats_opt_strs+1001)
150#define OUTPUT_DFT_ARG (rsstats_opt_strs+1008)
152#define OUTPUT_FLAGS (OPTST_DISABLED \
153 | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE))
159#define CLUSTERS_DESC (rsstats_opt_strs+1020)
161#define CLUSTERS_NAME (rsstats_opt_strs+1081)
163#define CLUSTERS_name (rsstats_opt_strs+1090)
165#define CLUSTERS_DFT_ARG (rsstats_opt_strs+1099)
167#define CLUSTERS_FLAGS (OPTST_DISABLED \
168 | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
174#define REPORTS_DESC (rsstats_opt_strs+1103)
176#define REPORTS_NAME (rsstats_opt_strs+1162)
178#define REPORTS_name (rsstats_opt_strs+1170)
180#define REPORTS_DFT_ARG (NULL)
181#define ReportsCookieBits VOIDP(REPORTS_BDBS|REPORTS_CLUSTER)
183#define REPORTS_FLAGS (OPTST_DISABLED \
184 | OPTST_SET_ARGTYPE(OPARG_TYPE_MEMBERSHIP))
189#define HELP_DESC (rsstats_opt_strs+1178)
190#define HELP_name (rsstats_opt_strs+1222)
191#ifdef HAVE_WORKING_FORK
192#define MORE_HELP_DESC (rsstats_opt_strs+1227)
193#define MORE_HELP_name (rsstats_opt_strs+1272)
194#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
196#define MORE_HELP_DESC HELP_DESC
197#define MORE_HELP_name HELP_name
198#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
200#ifdef NO_OPTIONAL_OPT_ARGS
201# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT)
203# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
204 OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
206#define VER_DESC (rsstats_opt_strs+1282)
207#define VER_name (rsstats_opt_strs+1318)
208#define SAVE_OPTS_DESC (rsstats_opt_strs+1326)
209#define SAVE_OPTS_name (rsstats_opt_strs+1365)
210#define LOAD_OPTS_DESC (rsstats_opt_strs+1375)
211#define LOAD_OPTS_NAME (rsstats_opt_strs+1407)
212#define NO_LOAD_OPTS_name (rsstats_opt_strs+1417)
213#define LOAD_OPTS_pfx (rsstats_opt_strs+1430)
214#define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3)
224 doOptInput, doOptOutput, doOptReports, doUsageOpt;
225#define VER_PROC optionPrintVersion
300 OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
324 OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
325 | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS,
337 OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
338 | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS,
350#define zPROGNAME (rsstats_opt_strs+1433)
352#define zUsageTitle (rsstats_opt_strs+1441)
354#define zRcName (rsstats_opt_strs+1570)
356static char const *
const apzHomeList[2] = {
357 rsstats_opt_strs+1564,
360#define zBugsAddr (rsstats_opt_strs+1581)
362#define zExplain (rsstats_opt_strs+1603)
364#define zDetail (rsstats_opt_strs+1672)
366#define zFullVersion (rsstats_opt_strs+1859)
369#if defined(ENABLE_NLS)
370# define OPTPROC_BASE OPTPROC_TRANSLATE
373# define OPTPROC_BASE OPTPROC_NONE
374# define translate_option_strings NULL
377#define rsstats_full_usage (NULL)
378#define rsstats_short_usage (NULL)
393doUsageOpt(tOptions * opts, tOptDesc * od)
412doOptInput(tOptions* pOptions, tOptDesc* pOptDesc)
414 static teOptFileType
const type =
415 FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
416 static tuFileMode mode;
425 optionFileCheck(pOptions, pOptDesc, type, mode);
436doOptOutput(tOptions* pOptions, tOptDesc* pOptDesc)
438 static teOptFileType
const type =
439 FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN;
440 static tuFileMode mode;
449 optionFileCheck(pOptions, pOptDesc, type, mode);
460doOptReports(tOptions* pOptions, tOptDesc* pOptDesc)
464 static char const *
const names[2] = {
470 optionSetMembers(pOptions, pOptDesc, names, 2);
478# define PKGDATADIR ""
486# define rsstats_packager_info NULL
490 "Packaged by " WITH_PACKAGER
492# ifdef WITH_PACKAGER_VERSION
493 " ("WITH_PACKAGER_VERSION
")"
496# ifdef WITH_PACKAGER_BUG_REPORTS
497 "\nReport rsstats bugs to " WITH_PACKAGER_BUG_REPORTS
509 OPTIONS_STRUCT_VERSION,
518 + OPTPROC_GNUUSAGE ),
555#include <autoopts/usage-txt.h>
557static char * AO_gettext(
char const * pz);
558static void coerce_it(
void ** s);
571AO_gettext(
char const * pz)
582 if (option_xlateable_txt.field_ct != 0) {
583 res = dgettext(
"libopts", pz);
585 res = (
char *)VOIDP(
_(pz));
587 res = (
char *)VOIDP(
_(pz));
589 res = (
char *)VOIDP(
_(pz));
595 fputs(
_(
"No memory for duping translated strings\n"), stderr);
605static void coerce_it(
void ** s) { *s = AO_gettext(*s);
621 if (option_xlateable_txt.field_ct != 0) {
626 char ** ppz = (
char**)VOIDP(&(option_xlateable_txt));
627 int ix = option_xlateable_txt.field_ct;
631 *ppz = AO_gettext(*ppz);
634 option_xlateable_txt.field_ct = 0;
636 coerce_it(VOIDP(&(opts->pzCopyright)));
637 coerce_it(VOIDP(&(opts->pzCopyNotice)));
638 coerce_it(VOIDP(&(opts->pzFullVersion)));
639 coerce_it(VOIDP(&(opts->pzUsageTitle)));
640 coerce_it(VOIDP(&(opts->pzExplain)));
641 coerce_it(VOIDP(&(opts->pzDetail)));
643 tOptDesc * od = opts->pOptDesc;
644 for (ix = opts->optCt; ix > 0; ix--, od++)
645 coerce_it(VOIDP(&(od->pzText)));
651#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
653static void bogus_function(
void) {
671 puts(
_(
"rsstats 0.0.1\n\
672Copyright (C) 2024 Francois Cerbelle, all rights reserved.\n\
673This is free software. It is licensed for use, modification and\n\
674redistribution under the terms of the GNU General Public License,\n\
675version 3 or later <http://gnu.org/licenses/gpl.html>\n"));
678 puts(
_(
"rsstats is free software: you can redistribute it and/or modify it under\n\
679the terms of the GNU General Public License as published by the Free\n\
680Software Foundation, either version 3 of the License, or (at your option)\n\
681any later version.\n\n"));
682 puts(
_(
"rsstats is distributed in the hope that it will be useful, but WITHOUT ANY\n\
683WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n\
684FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\n\
686 puts(
_(
"You should have received a copy of the GNU General Public License along\n\
687with this program. If not, see <http://www.gnu.org/licenses/>.\n"));
690 puts(
_(
"input CSV file (default: clusterdef.csv)"));
693 puts(
_(
"output CVS filename for nodes information (default: rsstats.csv)"));
696 puts(
_(
"comma separated list of clusternames to query (default: all)"));
699 puts(
_(
"Comma separated list of reports to generate (default: all)"));
702 puts(
_(
"display extended usage information and exit"));
705 puts(
_(
"extended usage information passed thru pager"));
708 puts(
_(
"output version information and exit"));
711 puts(
_(
"save the option state to a config file"));
714 puts(
_(
"load options from a config file"));
717 puts(
_(
"rsstats - Redis Enterprise Software cluster statistic extraction\n\
718Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
721 puts(
_(
"additional information given whenever the usage routine is invoked.\n"));
724 puts(
_(
"This string is added to the usage output when the HELP option is selected.\n\
725The contents of the file 'rsstats.details' is added to the usage output\n\
726when the MORE-HELP option is selected.\n"));
729 puts(
_(
"rsstats 0.0.1"));
732 puts(
_(
"<<<NOT-FOUND>>>"));
735 puts(
_(
"<<<NOT-FOUND>>>"));
737#line 67 "../autoopts.c"
738 puts(
_(
"allocation of %d bytes failed\n"));
739#line 89 "../autoopts.c"
740 puts(
_(
"allocation of %d bytes failed\n"));
742 puts(
_(
"AutoOpts function called without option descriptor\n"));
744 puts(
_(
"\tThis exceeds the compiled library version: "));
746 puts(
_(
"Automated Options Processing Error!\n"
747 "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
748#line 78 "../autoopts.c"
749 puts(
_(
"realloc of %d bytes at 0x%p failed\n"));
751 puts(
_(
"\tThis is less than the minimum library version: "));
752#line 121 "../version.c"
753 puts(
_(
"Automated Options version %s\n"
754 "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
755#line 49 "../makeshell.c"
756 puts(
_(
"(AutoOpts bug): %s.\n"));
758 puts(
_(
"optionResetOpt() called, but reset-option not configured"));
759#line 241 "../usage.c"
760 puts(
_(
"could not locate the 'help' option"));
761#line 330 "../autoopts.c"
762 puts(
_(
"optionProcess() was called with invalid data"));
763#line 697 "../usage.c"
764 puts(
_(
"invalid argument type specified"));
766 puts(
_(
"defaulted to option with optional arg"));
768 puts(
_(
"aliasing option is out of range."));
770 puts(
_(
"%s error: the keyword '%s' is ambiguous for %s\n"));
772 puts(
_(
" The following options match:\n"));
774 puts(
_(
"%s: ambiguous option name: %s (matches %d options)\n"));
775#line 161 "../check.c"
776 puts(
_(
"%s: Command line arguments required\n"));
778 puts(
_(
"%d %s%s options allowed\n"));
779#line 56 "../makeshell.c"
780 puts(
_(
"%s error %d (%s) calling %s for '%s'\n"));
781#line 268 "../makeshell.c"
782 puts(
_(
"interprocess pipe"));
783#line 171 "../version.c"
784 puts(
_(
"error: version option argument '%c' invalid. Use:\n"
785 "\t'v' - version only\n"
786 "\t'c' - version and copyright\n"
787 "\t'n' - version and full copyright notice\n"));
789 puts(
_(
"%s error: the '%s' and '%s' options conflict\n"));
791 puts(
_(
"%s: The '%s' option has been disabled."));
793 puts(
_(
"%s: The '%s' option has been disabled."));
795 puts(
_(
"-equivalence"));
797 puts(
_(
"%s: illegal option -- %c\n"));
798#line 110 "../reset.c"
799 puts(
_(
"%s: illegal option -- %c\n"));
801 puts(
_(
"%s: illegal option -- %s\n"));
803 puts(
_(
"%s: illegal option -- %s\n"));
804#line 118 "../reset.c"
805 puts(
_(
"%s: illegal option -- %s\n"));
807 puts(
_(
"%s: unknown vendor extension option -- %s\n"));
809 puts(
_(
" or an integer from %d through %d\n"));
811 puts(
_(
" or an integer from %d through %d\n"));
812#line 696 "../usage.c"
813 puts(
_(
"%s error: invalid option descriptor for %s\n"));
814#line 1030 "../usage.c"
815 puts(
_(
"%s error: invalid option descriptor for %s\n"));
817 puts(
_(
"%s: invalid option name: %s\n"));
819 puts(
_(
"%s: The '%s' option requires an argument.\n"));
820#line 150 "../autoopts.c"
821 puts(
_(
"(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n"
822 "\t'%s' and '%s'."));
824 puts(
_(
"%s error: The %s option is required\n"));
826 puts(
_(
"%s: The '%s' option cannot have an argument.\n"));
827#line 151 "../check.c"
828 puts(
_(
"%s: Command line arguments are not allowed.\n"));
830 puts(
_(
"error %d (%s) creating %s\n"));
832 puts(
_(
"%s error: '%s' does not match any %s keywords.\n"));
834 puts(
_(
"%s error: The '%s' option requires an argument.\n"));
836 puts(
_(
"error %d (%s) stat-ing %s\n"));
838 puts(
_(
"error %d (%s) stat-ing %s\n"));
839#line 143 "../restore.c"
840 puts(
_(
"%s error: no saved option state\n"));
841#line 225 "../autoopts.c"
842 puts(
_(
"'%s' is not a command line option.\n"));
844 puts(
_(
"%s error: '%s' is not a recognizable date/time.\n"));
846 puts(
_(
"%s error: '%s' is not a recognizable time duration.\n"));
848 puts(
_(
"%s error: The %s option must appear %d times.\n"));
849#line 165 "../numeric.c"
850 puts(
_(
"%s error: '%s' is not a recognizable number.\n"));
852 puts(
_(
"%s error: %s exceeds %s keyword count\n"));
853#line 279 "../usage.c"
854 puts(
_(
"Try '%s %s' for more information.\n"));
856 puts(
_(
"one %s%s option allowed\n"));
857#line 170 "../makeshell.c"
858 puts(
_(
"standard output"));
859#line 905 "../makeshell.c"
860 puts(
_(
"standard output"));
861#line 223 "../usage.c"
862 puts(
_(
"standard output"));
863#line 364 "../usage.c"
864 puts(
_(
"standard output"));
865#line 574 "../usage.c"
866 puts(
_(
"standard output"));
867#line 178 "../version.c"
868 puts(
_(
"standard output"));
869#line 223 "../usage.c"
870 puts(
_(
"standard error"));
871#line 364 "../usage.c"
872 puts(
_(
"standard error"));
873#line 574 "../usage.c"
874 puts(
_(
"standard error"));
875#line 178 "../version.c"
876 puts(
_(
"standard error"));
877#line 170 "../makeshell.c"
879#line 905 "../makeshell.c"
881#line 222 "../usage.c"
883#line 363 "../usage.c"
885#line 573 "../usage.c"
887#line 177 "../version.c"
889#line 60 "../numeric.c"
890 puts(
_(
"%s error: %s option value %ld is out of range.\n"));
892 puts(
_(
"%s error: %s option requires the %s option\n"));
894 puts(
_(
"%s warning: cannot save options - %s not regular file\n"));
896 puts(
_(
"%s warning: cannot save options - %s not regular file\n"));
898 puts(
_(
"%s warning: cannot save options - %s not regular file\n"));
900 puts(
_(
"%s warning: cannot save options - %s not regular file\n"));
904#line 822 "../usage.c"
905 puts(
_(
"\t\t\t\t- an alternate for '%s'\n"));
906#line 1097 "../usage.c"
907 puts(
_(
"Version, usage and configuration options:"));
908#line 873 "../usage.c"
909 puts(
_(
"\t\t\t\t- default option for unnamed options\n"));
910#line 786 "../usage.c"
911 puts(
_(
"\t\t\t\t- disabled as '--%s'\n"));
912#line 1066 "../usage.c"
913 puts(
_(
" --- %-14s %s\n"));
914#line 1064 "../usage.c"
915 puts(
_(
"This option has been disabled"));
916#line 813 "../usage.c"
917 puts(
_(
"\t\t\t\t- enabled by default\n"));
919 puts(
_(
"%s error: only "));
920#line 1143 "../usage.c"
921 puts(
_(
" - examining environment variables named %s_*\n"));
923 puts(
_(
"\t\t\t\t- file must not pre-exist\n"));
925 puts(
_(
"\t\t\t\t- file must pre-exist\n"));
926#line 329 "../usage.c"
927 puts(
_(
"Options are specified by doubled hyphens and their name or by a single\n"
928 "hyphen and the flag character.\n"));
929#line 882 "../makeshell.c"
931 "= = = = = = = =\n\n"
932 "This incarnation of genshell will produce\n"
933 "a shell script to parse the options for %s:\n\n"));
935 puts(
_(
" or an integer mask with any of the lower %d bits set\n"));
936#line 846 "../usage.c"
937 puts(
_(
"\t\t\t\t- is a set membership option\n"));
938#line 867 "../usage.c"
939 puts(
_(
"\t\t\t\t- must appear between %d and %d times\n"));
940#line 331 "../usage.c"
941 puts(
_(
"Options are specified by single or double hyphens and their name.\n"));
942#line 853 "../usage.c"
943 puts(
_(
"\t\t\t\t- may appear multiple times\n"));
944#line 840 "../usage.c"
945 puts(
_(
"\t\t\t\t- may not be preset\n"));
946#line 1258 "../usage.c"
947 puts(
_(
" Arg Option-Name Description\n"));
948#line 1194 "../usage.c"
949 puts(
_(
" Flg Arg Option-Name Description\n"));
950#line 1252 "../usage.c"
951 puts(
_(
" Flg Arg Option-Name Description\n"));
952#line 1253 "../usage.c"
954#line 1259 "../usage.c"
956#line 336 "../usage.c"
957 puts(
_(
"The '-#<number>' option may omit the hash char\n"));
958#line 332 "../usage.c"
959 puts(
_(
"All arguments are named options.\n"));
960#line 920 "../usage.c"
961 puts(
_(
" - reading file %s"));
962#line 358 "../usage.c"
964 "Please send bug reports to: <%s>\n"));
965#line 100 "../version.c"
967 "Please send bug reports to: <%s>\n"));
968#line 129 "../version.c"
970 "Please send bug reports to: <%s>\n"));
971#line 852 "../usage.c"
972 puts(
_(
"\t\t\t\t- may NOT appear - preset only\n"));
973#line 893 "../usage.c"
975 "The following option preset mechanisms are supported:\n"));
976#line 1141 "../usage.c"
978 "The following option preset mechanisms are supported:\n"));
979#line 631 "../usage.c"
980 puts(
_(
"prohibits these options:\n"));
981#line 626 "../usage.c"
982 puts(
_(
"prohibits the option '%s'\n"));
983#line 81 "../numeric.c"
984 puts(
_(
"%s%ld to %ld"));
985#line 79 "../numeric.c"
986 puts(
_(
"%sgreater than or equal to %ld"));
987#line 75 "../numeric.c"
988 puts(
_(
"%s%ld exactly"));
989#line 68 "../numeric.c"
990 puts(
_(
"%sit must lie in one of the ranges:\n"));
991#line 68 "../numeric.c"
992 puts(
_(
"%sit must be in the range:\n"));
993#line 88 "../numeric.c"
995#line 66 "../numeric.c"
996 puts(
_(
"%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
997#line 77 "../numeric.c"
998 puts(
_(
"%sless than or equal to %ld"));
999#line 339 "../usage.c"
1000 puts(
_(
"Operands and options may be intermixed. They will be reordered.\n"));
1001#line 601 "../usage.c"
1002 puts(
_(
"requires the option '%s'\n"));
1003#line 604 "../usage.c"
1004 puts(
_(
"requires these options:\n"));
1005#line 1270 "../usage.c"
1006 puts(
_(
" Arg Option-Name Req? Description\n"));
1007#line 1264 "../usage.c"
1008 puts(
_(
" Flg Arg Option-Name Req? Description\n"));
1009#line 143 "../enum.c"
1010 puts(
_(
"or you may use a numeric representation. Preceding these with a '!'\n"
1011 "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
1012 "will set them all. Multiple entries may be passed as an option\n"
1013 "argument list.\n"));
1014#line 859 "../usage.c"
1015 puts(
_(
"\t\t\t\t- may appear up to %d times\n"));
1017 puts(
_(
"The valid \"%s\" option keywords are:\n"));
1018#line 1101 "../usage.c"
1019 puts(
_(
"The next option supports vendor supported extra options:"));
1020#line 722 "../usage.c"
1021 puts(
_(
"These additional options are:"));