static const char *app_name;
+static void version() {
+ con_out("GMQCC %d.%d.%d Built %s %s\n",
+ GMQCC_VERSION_MINOR,
+ GMQCC_VERSION_MAJOR,
+ GMQCC_VERSION_PATCH,
+ __DATE__,
+ __TIME__
+ );
+}
+
static int usage() {
con_out("usage: %s [options] [files...]", app_name);
con_out("options:\n"
/* break; never reached because of exit(0) */
case 'v':
- con_out("GMQCC %d.%d.%d Built %s %s\n",
- GMQCC_VERSION_MINOR,
- GMQCC_VERSION_MAJOR,
- GMQCC_VERSION_PATCH,
- __DATE__,
- __TIME__
- );
+ version();
exit(0);
case 'E':
usage();
exit(0);
}
+ else if (!strcmp(argv[0]+2, "version")) {
+ version();
+ exit(0);
+ }
else {
/* All long options with arguments */
if (options_long_witharg("output", &argc, &argv, &argarg)) {