Add -nolog arg for windows users to disable fteqcc.log files (and a -log arg for non-windows users).

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5697 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2020-05-29 10:27:43 +00:00
parent 53deb25340
commit df5b4e4e48
3 changed files with 25 additions and 4 deletions

View File

@ -729,6 +729,10 @@ int GUI_ParseCommandLine(const char *args, pbool keepsrcanddir)
{
fl_log = true;
}
else if (!strnicmp(parameters+paramlen, "-nolog", 4) || !strnicmp(parameters+paramlen, "/nolog", 4))
{
fl_log = false;
}
else if (!strnicmp(parameters+paramlen, "-engine", 7) || !strnicmp(parameters+paramlen, "/engine", 7))
{
while (*next == ' ')

View File

@ -2490,7 +2490,7 @@ strofs = (strofs+3)&~3;
externs->Printf("Compile finished: %s (hexen2 format)\n", destfile);
break;
case QCF_DARKPLACES:
externs->Printf("Compile finished: %s (dp format)\n", destfile);
externs->Printf("Compile finished: %s (patched-dp format)\n", destfile);
break;
case QCF_FTE:
externs->Printf("Compile finished: %s (fte format)\n", destfile);
@ -4386,6 +4386,9 @@ static void QCC_PR_CommandLinePrecompilerOptions (void)
else if ( !strcmp(myargv[i], "-stdout") )
{
}
else if ( !strcmp(myargv[i], "-log") || !strcmp(myargv[i], "-nolog") )
{
}
else if ( !strcmp(myargv[i], "--version") )
{
externs->Printf("%s\n", QCC_VersionString());

View File

@ -119,6 +119,11 @@ int main (int argc, const char **argv)
{
unsigned int i;
pbool sucess;
#ifdef _WIN32
pbool writelog = true; //spew log files on windows. windows often closes the window as soon as the program ends making its output otherwise unreadable.
#else
pbool writelog = false; //other systems are sane.
#endif
progexterns_t ext;
progfuncs_t funcs;
progfuncs = &funcs;
@ -145,15 +150,24 @@ int main (int argc, const char **argv)
}
#endif
for (i = 0; i < argc; i++)
{
if (!argv[i])
continue;
if (strcmp(argv[i], "-log"))
writelog = true;
else if (strcmp(argv[i], "-nolog"))
writelog = false;
}
logfile = writelog?fopen("fteqcc.log", "wt"):false;
#ifdef _WIN32
logfile = fopen("fteqcc.log", "wt");
#endif
if (logfile)
{
fputs("Args:", logfile);
for (i = 0; i < argc; i++)
{
if (!argv[i])
continue;
if (strchr(argv[i], ' '))
fprintf(logfile, " \"%s\"", argv[i]);
else