WinMerge / winmerge

WinMerge is an Open Source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle.
https://winmerge.org/
GNU General Public License v2.0
6.43k stars 798 forks source link

On winmerge-2.16.40 /enableexitcode always exitcode = 0 #2360

Closed fredmestcloud closed 3 months ago

fredmestcloud commented 3 months ago

Hello, your documentation specify /enableexitcode Sets the comparison result to the process exit code. 0: identical, 1: different, 2: error

My use case in powershell $process = (Start-Process -PassThru -Wait -NoNewWindow -FilePath "winmerge-2.16.40\WinMergeU.exe" -ArgumentList ""file1" "file2" /xq /l /enableexitcode /noninteractive /or "file.diff.html"") $process.ExitCode always 0

In command prompt winmerge-2.16.40\WinMergeU.exe file1 file2 /xq /l /enableexitcode /noninteractive /or file.diff.html echo %ERRORLEVEL% Display always 0

Thanks for help

sdottaka commented 3 months ago

You have specified the /l command line option, which specifies the line number, so you must specify a number, but instead you have specified /enableexitcode. This is why it doesn't work properly. If you remove the /l option and run it, you should get the results you expect. Also, in the command prompt, run it as follows to wait until WinMerge has finished.

start /w "" winmerge-2.16.40\WinMergeU.exe file1 file2 /xq /enableexitcode /noninteractive /or file.diff.html
fredmestcloud commented 3 months ago

Oups sorry

i remark with /l option without number obtain file.diff.html only with change on file1 and file2.

i found not option for this. Is this option planned for the future?

sdottaka commented 3 months ago

Although undocumented, the /cfg DiffContextV2=0 command line option will cause only the differences to be output.