xboard-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XBoard-devel] mime types


From: h.g. muller
Subject: Re: [XBoard-devel] mime types
Date: Sun, 02 Oct 2011 09:43:36 +0200

At 14:48 1-10-2011 -0700, Arun Persaud wrote:
On 10/01/2011 02:40 PM, Tim Mann wrote:
> Adding more executables would work, though it's a bit inelegant.

yes, a bit ugly... I would think that there should be a way around this,
but I haven't found it so far

Can't we use shell scripts for this

> xboard doesn't currently take any non-flag arguments, does it? ISTR that
> WinBoard used be able to take a .pgn file as a non-flag argument. You
> could add code to look at one non-flag argument and take different
> actions depending on its extension (or on identifying it by the first
> few characters of content, if possible).

Perhaps it would be worthwhile to make XBoard more intelligent in the
long run and get rid of the lpf lgf and tf options and just figure out
what kind of file we are looking at before loading it?

Actually XBoard does support positional arguments, as WinBoard and
XBoard now share the option-handling code. A single positional argument
will be taken as a loadGameFile.

The code seems buggy, though, when more than one argument is present,
as it increments posarg on each argument, and the list mapping position
to option name only has a single option in it before the sentinel.

But this is definitely an alternative, although it would require some
reprogramming, as the presence of a .TRN positional argument should
imply setting of two options (-matchMode and -tourneyFile). Similarly,
it might be desirable to include -noChessProgram with a .PGN or.FEN
positional argument, to start in game-viewer mode. This is at least how
I distribute WinBoard.Of course there might be users that would prefer
an automatic startup of their favorite analysis engine on the PGN instead.

What do we think about that? Automatic -ncp mode, or with engine?
Note that in tournament mode -ncp will not hurt, as XBoard would be
automatically loading engines as per tourneyFile instructions during
the tourney, And loading the default engine that might not even be in
the tourney at startup would just be a waste of time. So I could make
any positional argument imply -ncp. OTOH, a tourneyFile would require
setting of at least one other option, matchMode, so I might as well
set -ncp too in that case, and let XBoard start in default mode for PGN
and FEN.

An alternative is this:
We could let the extension of a positional argument imply a settings file,
e.g.

xboard xxx.pgn

could be made equivalent to

xboard -lpf xxx.pgn @pgn.ini

i.e. instead of imagining a -ncp option we could imagine an @pgn option,
and the pgn.ini file would allow configuration of XBoard for the PGN case
in any way we (or the user) wants. (And even define his own file types.)
The question would be where to best put these pgn.ini, fen.ini and trn.ini
files. /etc is probably not a good ide, and the users home directory also
does not seem so hot.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]