X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=args.h;h=c6914b0e54307d9f6f0802a3d97e7816dca37b7b;hb=4223777243f0d5c358c15307b5131d94a8030a3d;hp=29249932da32a3639ddbf0e617e09afd445df215;hpb=09822b16d43fe8f9c3ef6a22360b4448efc73770;p=xboard.git diff --git a/args.h b/args.h index 2924993..c6914b0 100644 --- a/args.h +++ b/args.h @@ -223,7 +223,7 @@ ArgDescriptor argDescriptors[] = { { "flashRate", ArgInt, (void *) &appData.flashRate, XBOARD, (ArgIniType) FLASH_RATE }, { "pieceImageDirectory", ArgFilename, (void *) &appData.pieceDirectory, TRUE, (ArgIniType) "" }, { "pid", ArgFilename, (void *) &appData.pieceDirectory, FALSE, INVALID }, - { "trueColors", ArgBoolean, (void *) &appData.trueColors, TRUE, (ArgIniType) FALSE }, + { "trueColors", ArgBoolean, (void *) &appData.trueColors, XBOARD, (ArgIniType) (2*!XBOARD) }, { "jewelled", ArgInt, (void *) &appData.jewelled, FALSE, (ArgIniType) -1 }, { "soundDirectory", ArgFilename, (void *) &appData.soundDirectory, XBOARD, (ArgIniType) "" }, { "msLoginDelay", ArgInt, (void *) &appData.msLoginDelay, XBOARD, (ArgIniType) MS_LOGIN_DELAY }, @@ -617,6 +617,7 @@ ArgDescriptor argDescriptors[] = { { "epd", ArgTrue, (void *) &appData.epd, FALSE, INVALID }, { "inscriptions", ArgString, (void *) &appData.inscriptions, FALSE, (ArgIniType) "" }, { "autoInstall", ArgString, (void *) &appData.autoInstall, XBOARD, (ArgIniType) "" }, + { "replace", ArgString, (void *) &replace, FALSE, (ArgIniType) NULL }, { "fixedSize", ArgBoolean, (void *) &appData.fixedSize, TRUE, (ArgIniType) FALSE }, { "showMoveTime", ArgBoolean, (void *) &appData.moveTime, TRUE, (ArgIniType) FALSE }, @@ -1182,6 +1183,11 @@ ParseArgs(GetFunc get, void *cl) ASSIGN(*(char **) ad->argLoc, buf); break; } + if(replace) { // previous -replace option makes this string option conditional + char *p = replace; + free(replace); replace = NULL; // but expires in the process + if(strcmp(*(char**) ad->argLoc, p)) break; // only use to replace the given string + } ASSIGN(*(char **) ad->argLoc, argValue); break;