From: H.G.Muller Date: Tue, 22 Mar 2016 13:56:10 +0000 (+0100) Subject: Add -fen option X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=635daf56748af66bf3185d85fb83b12280ef6c83;p=xboard.git Add -fen option A volatile string option -fen can now be used to set the initial position of the initial variant through the command line, removing the need to prepare a position file for this. Otherwise the effect should be the same as when using -lpf: New games will be started from the specifoed positon until the New Variant dialog is used. The position is 'auto-sizing', i.e. the FEN is used to set the board geometry as well. --- diff --git a/args.h b/args.h index 866a6a9..a2f3b46 100644 --- a/args.h +++ b/args.h @@ -714,6 +714,7 @@ ArgDescriptor argDescriptors[] = { { "memoHeaders", ArgBoolean, (void *) &appData.headers, TRUE, (ArgIniType) FALSE }, { "startupMessage", ArgString, (void *) &appData.message, FALSE, (ArgIniType) "" }, { "messageSuppress", ArgString, (void *) &appData.suppress, XBOARD, (ArgIniType) "" }, + { "fen", ArgString, (void *) &appData.fen, FALSE, (ArgIniType) "" }, #if ZIPPY { "zippyTalk", ArgBoolean, (void *) &appData.zippyTalk, FALSE, (ArgIniType) ZIPPY_TALK }, diff --git a/backend.c b/backend.c index e7cf5b2..c5be312 100644 --- a/backend.c +++ b/backend.c @@ -1743,6 +1743,11 @@ InitBackEnd3 P((void)) CopyBoard(filePosition, boards[0]); CopyBoard(initialPosition, boards[0]); } + } else if(*appData.fen != NULLCHAR) { + if(ParseFEN(filePosition, &blackPlaysFirst, appData.fen, TRUE) && !blackPlaysFirst) { + startedFromPositionFile = TRUE; + Reset(TRUE, TRUE); + } } if (initialMode == AnalyzeMode) { if (appData.noChessProgram) { diff --git a/common.h b/common.h index c98ba91..6c2a60f 100644 --- a/common.h +++ b/common.h @@ -800,6 +800,7 @@ typedef struct { char *recentEngineList; char *message; char *suppress; + char *fen; char *tourneyFile; char *defName; char *processes;