Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -158,7 +158,11 @@ BOOL syslog_always=FALSE; ...@@ -158,7 +158,11 @@ BOOL syslog_always=FALSE;
static const char* prompt; 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" "\n"
"Global settings:\n" "Global settings:\n"
"\n" "\n"
...@@ -222,7 +226,7 @@ static const char* web_usage = "Web server settings:\n" ...@@ -222,7 +226,7 @@ static const char* web_usage = "Web server settings:\n"
"\n" "\n"
"\twp<port> set HTTP server port\n" "\twp<port> set HTTP server port\n"
"\two<value> set Web server option value (advanced)\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) static int lputs(int level, char *str)
...@@ -1565,6 +1569,26 @@ int main(int argc, char** argv) ...@@ -1565,6 +1569,26 @@ int main(int argc, char** argv)
strcpy(ini_file,arg); strcpy(ini_file,arg);
continue; 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")) { if(!stricmp(arg,"ni")) {
ini_file[0]=0; ini_file[0]=0;
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment