When using TCC (v23.00.25 x64 on Win7 SP1) I find that the Subversion (svn) diff command doesn't get parsed the same way as cmd.exe does it.
In order for svn to integrate with a GUI diff utility, you write a script that parses a bunch of command line options then have the script turn around and pass the options in the order and with the switches appropriate for the GUI diff program (Beyond Compare in my case).
I found that the script that was working in cmd.exe broke when I tried it in TCC. Here's a version of the script that simply dumps the arguments passed to it:
=============
@echo off
echo all args: :%*:
echo arg1: :%1:
echo arg2: :%2:
echo arg3: :%3:
echo arg4: :%4:
echo arg5: :%5:
echo arg6: :%6:
echo arg7: :%7:
echo arg8: :%8:
=============
Here's what cmd.exe displays when svn passes the diff arguments to it:
=============
all args: :-u -L "CalcsMgr/CalcsMgr.c (revision 38085)" -L "CalcsMgr/CalcsMgr.c (working copy)" D:\devtrees\CPA_ExtRAM\trunk\.svn\pristine\19\19ec3da79b2b6ceb9eced5aee49da6d1efe261cb.svn-base C:\Users\burrm\AppData\Local\Temp\svn-4DC6D8A0:
arg1: :-u:
arg2: :-L:
arg3: :"CalcsMgr/CalcsMgr.c (revision 38085)":
arg4: :-L:
arg5: :"CalcsMgr/CalcsMgr.c (working copy)":
arg6: :D:\devtrees\CPA_ExtRAM\trunk\.svn\pristine\19\19ec3da79b2b6ceb9eced5aee49da6d1efe261cb.svn-base:
arg7: :C:\Users\burrm\AppData\Local\Temp\svn-4DC6D8A0:
arg8: ::
=============
And here's what I get when the script is run in TCC:
=============
all args: :*:
arg1: :-u:
arg2: :-L:
arg3: :"CalcsMgr/CalcsMgr.c:
arg4: :(revision:
arg5: :38085)":
arg6: :-L:
arg7: :"CalcsMgr/CalcsMgr.c:
arg8: :(working:
=============
So my questions are:
- is this a TCC bug?
- if not, is there a way I can have one batch file that parses the command line the same way in both cmd.exe and in TCC?
- why doesn't TCC expand the %* construct when it is immediately followed by a ':'? It only does this when it is immediately followed by a colon - and I often use a colon as a delimiter when debugging command line arguments because I find that using quotes makes it difficult to spot how quotes are actually being used.
Thanks
In order for svn to integrate with a GUI diff utility, you write a script that parses a bunch of command line options then have the script turn around and pass the options in the order and with the switches appropriate for the GUI diff program (Beyond Compare in my case).
I found that the script that was working in cmd.exe broke when I tried it in TCC. Here's a version of the script that simply dumps the arguments passed to it:
=============
@echo off
echo all args: :%*:
echo arg1: :%1:
echo arg2: :%2:
echo arg3: :%3:
echo arg4: :%4:
echo arg5: :%5:
echo arg6: :%6:
echo arg7: :%7:
echo arg8: :%8:
=============
Here's what cmd.exe displays when svn passes the diff arguments to it:
=============
all args: :-u -L "CalcsMgr/CalcsMgr.c (revision 38085)" -L "CalcsMgr/CalcsMgr.c (working copy)" D:\devtrees\CPA_ExtRAM\trunk\.svn\pristine\19\19ec3da79b2b6ceb9eced5aee49da6d1efe261cb.svn-base C:\Users\burrm\AppData\Local\Temp\svn-4DC6D8A0:
arg1: :-u:
arg2: :-L:
arg3: :"CalcsMgr/CalcsMgr.c (revision 38085)":
arg4: :-L:
arg5: :"CalcsMgr/CalcsMgr.c (working copy)":
arg6: :D:\devtrees\CPA_ExtRAM\trunk\.svn\pristine\19\19ec3da79b2b6ceb9eced5aee49da6d1efe261cb.svn-base:
arg7: :C:\Users\burrm\AppData\Local\Temp\svn-4DC6D8A0:
arg8: ::
=============
And here's what I get when the script is run in TCC:
=============
all args: :*:
arg1: :-u:
arg2: :-L:
arg3: :"CalcsMgr/CalcsMgr.c:
arg4: :(revision:
arg5: :38085)":
arg6: :-L:
arg7: :"CalcsMgr/CalcsMgr.c:
arg8: :(working:
=============
So my questions are:
- is this a TCC bug?
- if not, is there a way I can have one batch file that parses the command line the same way in both cmd.exe and in TCC?
- why doesn't TCC expand the %* construct when it is immediately followed by a ':'? It only does this when it is immediately followed by a colon - and I often use a colon as a delimiter when debugging command line arguments because I find that using quotes makes it difficult to spot how quotes are actually being used.
Thanks