On 4/27/07, Tom Spear speeddymon@gmail.com wrote:
On 4/27/07, Alexandre Julliard julliard@winehq.org wrote:
You don't want to do that, even if you print usage, an invalid switch needs to cause an error.
So should we fprintf the usage statement and exit(1); or should we print both the usage, and the error for the invalid switch.
Unfortunately I don't have a copy of win98's regedit, and winxp's regedit does not accept command line switches (I have tried), so I can't check (easily) how the native regedit that ours is supposed to be command-line compatible with, does it.
Neither. I just figured out why /? is not working. I can't believe that I did not think of this before. The shell processes an unescaped ?. In order for it to work, I have to use /? .. If I just do /? then s ends up being /c /d and so ch ends up being c, which makes chu C (which is missing from the ignored switches if statement)..
With the old code:
regedit /c returns "regedit: Undefined switch /C!" regedit /? returns "regedit: Undefined switch /C!" regedit /C returns "regedit: Undefined switch /C!"
The usage shows /c and /C as being valid switches.
So.. I changed the line
if (chu == 'S' || chu == 'V') {
to
if (chu == 'S' || chu == 'V' || chu == 'C') {
and so now:
regedit /c opens regedit regedit /? shows the usage statement !!!!! regedit /C opens regedit
Is this a proper fix? Can I submit it? The diff is attached..