import std.stdio : writeln, stderr; import std.exception : collectException; import diff; int main(string[] args) { if (args.length != 3) { stderr.writeln("use: ", args[0], " OLD NEW"); return 1; } auto eng = new DiffEngine(3); string result; // сюда положим результат auto ex = collectException(result = eng.diffFiles(args[1], args[2])); if (ex !is null) { stderr.writeln(ex.msg); return 2; } writeln(result); return 0; }