Commands - GumTreeDiff/gumtree GitHub Wiki
In this page you will find the list and documentation of all GumTree commands.
Overriding properties
GumTree use some system properties. Their values can be overridden by using an option flag directly on the top-level gumtree command, as such:
gumtree -C PROPERTY VALUE
Diff commands
Here are the commands related to diffing source code files.
WebDiff
Usage
gumtree webdiff PATH1 PATH2
Description
webdiff starts a web server that displaying a diff between two files or two folders.
Arguments
PATH1the source path, either a file or a folder.PATH2the destination path, either a file or a folder (must be the same kind asPATH1).
Options
--port PORTchange the server port (default4567).-g TREE_GENERATOR_IDto force GumTree to use a specific tree generator.-m MATCHER_IDto force GumTree to use a specific matcher.-M PROPERTY VALUEadd a matcher property, available:bu_minsim,bu_minsize,st_minprio,st_priocalc,cd_labsim,cd_maxleaves,cd_structsim1,cd_structsim2,xy_minsim.-x COMMANDuse an external command to produce a XML compatible GumTree AST. The command must be of the formCOMMAND $FILEwhere$FILEwill be automatically replaced by the file to parse.
SwingDiff
Usage
gumtree swingdiff PATH1 PATH2
Description
swingdiff displays the diff between two files using the Swing java UI toolkit.
Arguments
PATH1the source path, either a file or a folder.PATH2the destination path, either a file or a folder (must be the same kind asPATH1).
Options
-g TREE_GENERATOR_IDto force GumTree to use a specific tree generator.-m MATCHER_IDto force GumTree to use a specific matcher.-M PROPERTY VALUEadd a matcher property, available:bu_minsim,bu_minsize,st_minprio,st_priocalc,cd_labsim,cd_maxleaves,cd_structsim1,cd_structsim2,xy_minsim.-x COMMANDuse an external command to produce a XML compatible GumTree AST. The command must be of the formCOMMAND $FILEwhere$FILEwill be automatically replaced by the file to parse.
HtmlDiff
Usage
gumtree htmldiff FILE1 FILE2
Description
webdiff starts a web server that displaying a diff between two files or two folders.
Arguments
FILE1the source path, a file.FILE2the destination path, a file.
Options
-g TREE_GENERATOR_IDto force GumTree to use a specific tree generator.-m MATCHER_IDto force GumTree to use a specific matcher.-M PROPERTY VALUEadd a matcher property, available:bu_minsim,bu_minsize,st_minprio,st_priocalc,cd_labsim,cd_maxleaves,cd_structsim1,cd_structsim2,xy_minsim.-x COMMANDuse an external command to produce a XML compatible GumTree AST. The command must be of the formCOMMAND $FILEwhere$FILEwill be automatically replaced by the file to parse.
TextDiff
Usage
gumtree textdiff PATH1 PATH2
Description
textdiff outputs the diff between two files in a textual format.
Arguments
PATH1the source path, must be a file.PATH2the destination path, must be a file.
Options
-f FORMATchange the format (defaultTEXT), availableTEXT,XML,JSON.-o FILEchange the output file (defaultstdout).-g TREE_GENERATOR_IDto force GumTree to use a specific tree generator.-m MATCHER_IDto force GumTree to use a specific matcher.-M PROPERTY VALUEadd a matcher property, available:bu_minsim,bu_minsize,st_minprio,st_priocalc,cd_labsim,cd_maxleaves,cd_structsim1,cd_structsim2,xy_minsim.-x COMMANDuse an external command to produce a XML compatible GumTree AST. The command must be of the formCOMMAND $FILEwhere$FILEwill be automatically replaced by the file to parse.
DotDiff
Usage
gumtree dotdiff PATH1 PATH2
Description
dotdiff outputs the diff between two files in GraphViz's dot format, that can then be transformed using the dot command to SVG, PDF, ... See graphviz.
Arguments
PATH1the source path, must be a file.PATH2the destination path, must be a file.
Options
-g TREE_GENERATOR_IDto force GumTree to use a specific tree generator.-m MATCHER_IDto force GumTree to use a specific matcher.-M PROPERTY VALUEadd a matcher property, available:bu_minsim,bu_minsize,st_minprio,st_priocalc,cd_labsim,cd_maxleaves,cd_structsim1,cd_structsim2,xy_minsim.-x COMMANDuse an external command to produce a XML compatible GumTree AST. The command must be of the formCOMMAND $FILEwhere$FILEwill be automatically replaced by the file to parse.
Utility commands
List
Usage
gumtree list ELEMENTS
Description
list displays a list of GumTree's matchers, tree generators, properties and clients (commands).
Arguments
ELEMENTSeitherMATCHERS,GENERATORS,PROPERTIESorCLIENTS.
Parse
Usage
gumtree parse PATH
Description
parse outputs the AST corresponding to a given file.
Arguments
PATHthe file path.
Options
-g TREE_GENERATOR_IDto force GumTree to use a specific tree generator.-x COMMANDuse an external command to produce a XML compatible GumTree AST. The command must be of the formCOMMAND $FILEwhere$FILEwill be automatically replaced by the file to parse.