return result;
}
+static void print_version_info(void)
+{
+ printf("Moonshot TID Server %s\n\n", PACKAGE_VERSION);
+}
+
/* command-line option setup */
/* argp global parameters */
const char *argp_program_bug_address=PACKAGE_BUGREPORT; /* bug reporting address */
/* doc strings */
-static const char doc[]=PACKAGE_NAME " - TID Server";
+static const char doc[]=PACKAGE_NAME " - Moonshot TID Server " PACKAGE_VERSION;
static const char arg_doc[]="<ip-address> <gss-name> <hostname> <database-name>"; /* string describing arguments, if any */
/* define the options here. Fields are:
* { long-name, short-name, variable name, options, help description } */
static const struct argp_option cmdline_options[] = {
+ { "version", 'v', NULL, 0, "Print version information and exit"},
{ NULL }
};
}
break;
+ case 'v':
+ print_version_info();
+ exit(0);
+
default:
return ARGP_ERR_UNKNOWN;
}
{
TIDS_INSTANCE *tids;
TR_NAME *gssname = NULL;
- struct cmdline_args opts={NULL};
+ struct cmdline_args opts={0};
/* parse the command line*/
argp_parse(&argp, argc, argv, 0, 0, &opts);
+ print_version_info();
+
talloc_set_log_stderr();
/* Use standalone logging */