xboard-devel
[Top][All Lists]
Advanced

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

Re: [XBoard-devel] file associations / positional arguments


From: Eric Mullins
Subject: Re: [XBoard-devel] file associations / positional arguments
Date: Wed, 19 Sep 2012 09:15:10 -0600
User-agent: Mozilla/5.0 (Windows NT 5.2; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1

Back when I wrote MFC stuff, you could ship a .reg file and then invoke CWinApp::RegisterShellFileTypes during initialization. This method
doesn't seem to work with recent windows because lacking admin privs,
everything outside of HKCU would not be modified.

However, that's really what you need to do-- add the proper registry entries at runtime to make associations work right. Usually the installer does that, but lacking an installer, the program has to do it if you want that functionality.

On 9/19/2012 1:51 AM, h.g. muller wrote:
I had to make one backward-compatibility breaking change to make this
work satisfactorily.
Problem is that Windows filenames often do contain spaces, and that the
OS, when you
use the "Open with..." menu item on a document, is not so friendly as to
quote this filename.
So WinBoard will be confronted with command lines like

   winboard.exe Candidate Matches.pgn
   winboard.exe KingCheck ICS.xsf

The existing code would then complain that Matches.pgn was an invalid
option (as only a single
positional argument would be accepted), and even if it survived that,
its attempts to open the
file Candidate would likely come to nothing.

So I now made it such that when reading the value of a positional
argument, spaces are not
considered a termination character, but are considered part of the arg
value. This, however,
would break a usage like

   winboard.exe games.pgn -ncp

which in the old system would be parsed like

   winboard.exe -lgf games.pgn -ncp

but now would be interpreted as

   winboard.exe -lgf "games.pgn -ncp"

Is there any legitimate of such a mixture of position arguments and
regular command-line options?
And even if there is, should we continue to support it?







reply via email to

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