PageRenderTime 669ms CodeModel.GetById 661ms app.highlight 1ms RepoModel.GetById 6ms app.codeStats 0ms

/bundles/plugins-trunk/Console/console/commands/diff.xml

#
XML | 127 lines | 100 code | 24 blank | 3 comment | 0 complexity | da6319378073bcb241da9be873784914 MD5 | raw file
  1<?xml version="1.0" ?>
  2<!DOCTYPE COMMANDO SYSTEM "commando.dtd">
  3
  4<!-- This was based around the 'diff' from GNU diffutils 2.7.
  5     It should also work with Cygwin diff, and diffs from other
  6     Unices, but some options might not be supported. -->
  7
  8<COMMANDO>
  9	<UI>
 10		<CAPTION LABEL="File specification">
 11
 12		<FILE_ENTRY LABEL="Original file" VARNAME="from"
 13			EVAL="buffer.getPath() + '~'" />
 14		<FILE_ENTRY LABEL="Changed file" VARNAME="to"
 15			EVAL="buffer.getPath()" />
 16
 17		<TOGGLE LABEL="Recursively compare directories"
 18			VARNAME="recursive" />
 19		<ENTRY LABEL="Ignore files regexp" VARNAME="ignore" />
 20
 21		</CAPTION>
 22
 23		<CAPTION LABEL="Options">
 24
 25		<TOGGLE LABEL="Treat files as text, even if binary"
 26			VARNAME="binary" />
 27		<TOGGLE LABEL="Ignore changes in white space"
 28			VARNAME="whitespace" />
 29		<TOGGLE LABEL="Ignore addition and removal of blank lines"
 30			VARNAME="blankLines" />
 31		<TOGGLE LABEL="Expand tabs in output" VARNAME="softTabs" />
 32		<TOGGLE LABEL="Ignore case" VARNAME="ignoreCase" />
 33		<TOGGLE LABEL="Handle missing files" VARNAME="newFile" />
 34		<TOGGLE LABEL="Report which files are the same"
 35			VARNAME="identical" />
 36
 37		<CHOICE LABEL="Algorithm" VARNAME="algorithm">
 38			<OPTION LABEL="Default" VALUE="default" />
 39			<OPTION LABEL="More accurate but slower" VALUE="slow" />
 40			<OPTION LABEL="Large files with many small changes"
 41				VALUE="large" />
 42		</CHOICE>
 43
 44		<CHOICE LABEL="Output format" VARNAME="output" DEFAULT="unified">
 45			<OPTION LABEL="Brief" VALUE="brief" />
 46			<OPTION LABEL="Context" VALUE="context" />
 47			<OPTION LABEL="ED script" VALUE="ed" />
 48			<OPTION LABEL="RCS" VALUE="rcs" />
 49			<OPTION LABEL="Side by side" VALUE="sideBySide" />
 50			<OPTION LABEL="Unified" VALUE="unified" />
 51		</CHOICE>
 52
 53		<ENTRY LABEL="Lines of context" VARNAME="context" DEFAULT="3" />
 54
 55		</CAPTION>
 56	</UI>
 57
 58	<COMMANDS>
 59		<COMMAND CONFIRM="FALSE" TO_BUFFER="TRUE"
 60			BUFFER_MODE="patch" SHELL="System">
 61			StringBuffer buf = new StringBuffer("diff ");
 62
 63			if(recursive)
 64				buf.append(" -r");
 65
 66			if(!ignore.equals(""))
 67			{
 68				buf.append(" -X ");
 69				buf.append(ignore);
 70			}
 71
 72			if(binary)
 73				buf.append(" -a");
 74
 75			if(whitespace)
 76				buf.append(" -b");
 77
 78			if(blankLines)
 79				buf.append(" -B");
 80
 81			if(softTabs)
 82				buf.append(" -t");
 83
 84			if(ignoreCase)
 85				buf.append(" -i");
 86
 87			if(newFile)
 88				buf.append(" -N");
 89
 90			if(identical)
 91				buf.append(" -s");
 92
 93			if(algorithm.equals("slow"))
 94				buf.append(" -d");
 95			else if(algorithm.equals("large"))
 96				buf.append(" -H");
 97
 98			if(output.equals("brief"))
 99				buf.append(" -q");
100			else if(output.equals("context"))
101			{
102				buf.append(" -C ");
103				buf.append(context);
104			}
105			else if(output.equals("ed"))
106				buf.append(" -e");
107			else if(output.equals("rcs"))
108				buf.append(" -n");
109			else if(output.equals("sideBySide"))
110				buf.append(" -y");
111			else if(output.equals("unified"))
112			{
113				buf.append(" -U ");
114				buf.append(context);
115			}
116
117			buf.append(" \"");
118			buf.append(from);
119			buf.append("\" \"");
120			buf.append(to);
121			buf.append('"');
122
123			// return value
124			buf.toString();
125		</COMMAND>
126	</COMMANDS>
127</COMMANDO>