public static void main(String[] argv) throws IOException {
String filea = argv[argv.length - 2];
String fileb = argv[argv.length - 1];
String[] a = slurp(filea);
String[] b = slurp(fileb);
Diff d = new Diff(a,b);
char style = 'n';
d.heuristic = false;
for (int i = 0; i < argv.length - 2; ++i) {
String f = argv[i];
if (f.startsWith("-")) {
for (int j = 1; j < f.length(); ++j) {
switch (f.charAt(j)) {
case 'H': // heuristic on
d.heuristic = true; break;
case 'e': // Ed style
style = 'e'; break;
case 'c': // Context diff
style = 'c'; break;
case 'u':
style = 'u'; break;
}
}
}
}
boolean reverse = style == 'e';
Diff.change script = d.diff_2(reverse);
if (script == null)
System.err.println("No differences");
else {
Base p;
switch (style) {