Commit d140b5c0 authored by rswindell's avatar rswindell
Browse files

Add "version" command-line option to display version/revision details (ala the

SBBSCTRL "About" dialog box) and then exit.
parent 8de38a48
......@@ -158,7 +158,11 @@ BOOL syslog_always=FALSE;
static const char* prompt;
static const char* usage = "\nusage: %s [[setting] [...]] [path/ini_file]\n"
static const char* usage = "\nusage: %s [[cmd | setting] [...]] [path/ini_file]\n"
"\n"
"Commands:\n"
"\n"
"\tversion show version/revision details and exit\n"
"\n"
"Global settings:\n"
"\n"
......@@ -222,7 +226,7 @@ static const char* web_usage = "Web server settings:\n"
"\n"
"\twp<port> set HTTP server port\n"
"\two<value> set Web server option value (advanced)\n"
"\tw- disable Web server (no services module)\n"
"\tw- disable Web server\n"
;
static int lputs(int level, char *str)
......@@ -1565,6 +1569,26 @@ int main(int argc, char** argv)
strcpy(ini_file,arg);
continue;
}
if(stricmp(arg, "version") == 0) {
char revision[16];
sscanf("$Revision$", "%*s %s", revision);
char compiler[32];
DESCRIBE_COMPILER(compiler);
printf("%s\n", bbs_ver());
printf("%s\n", mail_ver());
printf("%s\n", ftp_ver());
printf("%s\n", web_ver());
printf("%s\n", services_ver());
printf("Synchronet Console %s%s Compiled %s %s with %s\n"
,revision
#ifdef _DEBUG
," Debug"
#else
,""
#endif
,__DATE__, __TIME__, compiler);
return EXIT_SUCCESS;
}
if(!stricmp(arg,"ni")) {
ini_file[0]=0;
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment