}
+static void print_version_info(void)
+{
+ printf("Moonshot TID Client %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 Client";
+static const char doc[]=PACKAGE_NAME " - Moonshot TID Client " PACKAGE_VERSION;
static const char arg_doc[]="<server> <RP-realm> <target-realm> <community> [<port>]"; /* 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[] = {
- { NULL }
+ { "version", 'v', NULL, 0, "Print version information and exit"},
+ { NULL }
};
/* structure for communicating with option parser */
}
break;
+ case 'v':
+ print_version_info();
+ exit(0);
+
default:
return ARGP_ERR_UNKNOWN;
}
argp_parse(&argp, argc, argv, 0, 0, &opts);
/* TBD -- validity checking, dealing with quotes, etc. */
+ print_version_info();
+
/* Use standalone logging */
tr_log_open();