42 #include <sys/select.h>
43 #include <sys/socket.h>
48 #include <sys/types.h>
59 fprintf(out,
"Usage: %s [<expr>]\n",
"ods-getconf");
60 fprintf(out,
"Simple command line tool to get the value of a "
61 "configuration option.\n\n");
62 fprintf(out,
"Supported options:\n");
63 fprintf(out,
" -c | --config <cfgfile> Read configuration from file.\n");
64 fprintf(out,
" -h | --help Show this help and exit.\n");
65 fprintf(out,
"\nBSD licensed, see LICENSE in source package for "
67 fprintf(out,
"Version %s. Report bugs to <%s>.\n",
68 PACKAGE_VERSION, PACKAGE_BUGREPORT);
79 fprintf(out,
"%s version %s\n", PACKAGE_NAME, PACKAGE_VERSION);
89 main(
int argc,
char* argv[])
92 int options_index = 0;
94 const char* cfgfile = ODS_SE_CFGFILE;
95 static struct option long_options[] = {
96 {
"config", required_argument, 0,
'c'},
97 {
"help", no_argument, 0,
'h'},
98 {
"version", no_argument, 0,
'V'},
102 while ((c=getopt_long(argc, argv,
"c:hV",
103 long_options, &options_index)) != -1) {
132 fprintf(stdout,
"%s", str);
135 fprintf(stdout,
"\n");
int main(int argc, char *argv[])
const char * parse_conf_string(const char *cfgfile, const char *expr, int required)