Syntax-aware code compare and merge
Command Line Interface
Through command line interface, Compare++ can easily integrate with other products such as version control system.
1. For 2way compare, the parameter format is:
Compare++ "%1" "%2"
E.g. for comparing file,
Compare++.exe "left file path name" "right file path name"
For comparing folder,
Compare++.exe "left folder path name" "right folder path name"
2. For 3way merge, the command line interface and options as follow:
-b, /b, or /base: specify base file path
-t, /t, or /their: specify their file path
-i, /i, or /mine: specify my file path
-m, /m, or /merged: specify to-save merged file path, optional
Compare++.exe /b "base_file" /t "their_file" /i "my_file" /m "merged_file"
Or don't specify merge file name in order to directly use my file name as merged file name.
Compare++.exe /b "base_file" /t "their_file" /i "my_file"
Compare++ also support to directly list file names. In order,
Compare++.exe "base_file" "their_file" "my_file" "merged_file"
3. Other options:
-output_unified_diff, or /output_unified_diff: generate unified diff report for file or folder comparison and will auto open the report file, optional
-unified_diff_file "file_path", or /unified_diff_file "file_path": specify the unified diff report file, used with "-output_unified_diff" and will not auto open, optional
-automation, or /automation: Using it with "-output_unified_diff", Compare++ can run in no GUI mode to generate unified diff, optional
For example, for reporting the comparison result between two folders, the command line interface could be
Compare++.exe -output_unified_diff -unified_diff_file "report.txt" -automation "left folder path name" "right folder path name"
-bk, /bk, or /backup_left_file: when comparing two files specified in command line,
auto backup the left file which is useful when using Compare++ in Microsoft TFS, work on 2.15 and later, optional
-h, /h, or /history: add the specified file name into history list, optional
-c, /c, or /compare_to_clipboard: compare the first specified file with the text in clipboard, optional