使用 VS11 来比对文件 (zz)


Dev 11 has a diff and merge view that is simply outstanding and using it to compare changes before checkin is just dreamy. I ran into a situation where I wanted to diff the output of two files and thought that it would be nice if I could do that in Dev 11. Popping into CTRL+Q and typing “diff” just says, “No search results available”, which isn’t very helpful.(IS2120@CSDN)

Figuring there had to be a command related to diffing, I looked up all the commands in the Keyboard Options page and ran into Tools.DiffFiles. Running that in the Command Windows did nothing so going for broke, I typed “Tools.DiffFiles c:\” and got a nice little autocomplete popup to choose the file. Obviously, Tools.DiffFiles takes two parameters, the first being the left side file, or the source, and the second being the right side file, or the target. Below shows an example from the Command Window

  1. Tools.DiffFiles c:\test\a.txt c:\test\b.txt

That’s great we’ve got the ability to do random diffs inside the IDE, but being a command line guy, I want to do the diffs directly from PowerShell even if Dev 11 isn’t running. It turned out to be far easier than I ever imagined. Checking the command line options to DEVENV.EXE, by running “devenv /?” showed there’s a new command line switch. /diff, that does exactly what I wanted. So anytime you want to use the Dev 11 diff tool, run the following:

  1. devenv /diff c:\foo\x.txt c:\bar\y.txt

If Dev 11 is running, you’ll get a new diff window in the running instance, otherwise, you’ll get a new copy of the IDE. Of course, you’ll need devenv.exe in the path so run VCVARSALL.BAT to get it in your path.

(IS2120@CSDN)

转载于:https://www.cnblogs.com/IS2120/archive/2012/03/16/6745923.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值