UltraCompare includes support for command line access, allowing you to automate compares with output information or integrate UltraCompare with your other applications, version control, etc. We will go over all command line parameters for UltraCompare’s different compare modes in the following sections:
The order and format of how these options are used is important. There are a few rules to remember when using UltraCompare’s command line functionality:
All parameters must be separated by a space.
“Compare mode selector” switches such as
-t
,
-3
,
-p
,
-x
,
-d
, and
-w
must always immediately
precede
the compared file(s)/folder(s) paths. Any other switches, e.g.
-o
,
-ne
,
-a
,
-title1
,
-ignt
,
-horz
, etc should
follow
the compared file(s)/folder(s) paths or should
precede
the mode selector switch.
Logical units can appear in any order on the command line so long as they are paired with their related parameters.
Synopsis
uc [COMPARE OPTIONS] [MODE SELECTOR] [COMPARED FILE/FOLDER PATHS] [COMPARE OPTIONS] [OUTPUT FILE PATH]
Correct example:
uc -i -lt -B -b -t <filepath1> <filepath2> -a -o <output file path>
Incorrect example:
uc -i -lt -o -B -b -t -a <filepath1> <filepath2> <output file path>
Correct example:
uc -w -r -dmf <folder1> -title1 "myFolder1" <folder2> -title2 "myFolder2" <folder3> -title3 "myFolder3" -o <output file path>
Incorrect example:
uc -w -r -dmf -o -title1 "myFolder1" -title2 "myFolder2" -title3 "myFolder3" <output file path> <folder1> <folder2> <folder3>
Examples:
Text compare with output:
uc -t "c:\1.txt" "c:\2.txt" -o "c:\output.txt"
Invokes a text compare of 1.txt and 2.txt (with default options) and automatically saves an output file to c:\output.txt
3-way text compare with output:
uc -3 "c:\1.txt" "c:\2.txt" "c:\3.txt" -o "c:\output.txt"
Invokes a 3-way text compare of 1.txt, 2.txt, and 3.txt and automatically saves an output file to c:\output.txt
Text compare with options and output:
uc -t -i -b -B "c:\1.txt" "c:\2.txt" -ne -o "c:\output.txt"
Invokes a 2-way text compare of 1.txt and 2.txt with “Ignore case”, “Ignore whitespace”, and “Ignore blank lines” set, and will only report differences in output file c:\output.txt
Text compare with advanced ignore options:
uc -t "c:\file.c" "c:\file2.c" -ignbtw "/*" "*/"
Invokes a text compare of file.c and file.c, ignoring all text between /* and */ (comments)
Read-only merge:
uc -rom "c:\file1.txt" "c:\file2.txt" "c:\result.txt"
Invokes a read-only merge of file1.txt and file2.txt – the differences are merged into “result.txt” and the original 2 files are not modified in any way
Text compare with horizontal layout:
uc -t "c:\1.txt" "c:\2.txt" -horz
Invokes a text compare of 1.txt and 2.txt and displays the compare frames horizontally in the GUI
Examples
Basic folder compare with output:
uc -d -dmb "c:\dir1" "c:\dir2" -o "c:\output.txt"
Invokes a basic folder compare of dir1 and dir2 and automatically saves an output file to c:\output.txt
Smart, recursive, 3-way folder compare with output:
uc -w -dms -r "c:\dir1" "c:\dir2" "c:\dir3" -o "c:\output.txt"
Invokes a smart recursive folder compare of dir1, dir2, and dir3 and automatically saves an output file to c:\output.txt
Smart, recursive folder compare with aliases:
uc -d -dms -r "c:\dir1" "c:\dir2" -title1 "myFolder1" -title2 "myFolder2"
Invokes a smart recursive folder compare of dir1 and dir2, and displays the directories in the GUI as “myFolder1” and “myFolder2”, respectively
Examples:
Git diff (used for “difftool” in .gitconfig):
uc -gitdt "$REMOTE" "$LOCAL" "$MERGED"-title1 "REMOTE" -title2 "LOCAL"
Invokes a diff of local changes against repository version using aliases “REMOTE” and “LOCAL”
Git merge (used for “mergetool” in .gitconfig):
uc -gitm "$REMOTE" "$LOCAL" "$BASE" "$MERGED"-title1 "REMOTE" -title2 "LOCAL"
Invokes a merge / conflict resolution in a special “Git merge” mode using aliases “REMOTE” and “LOCAL”