return errcode
This commit is contained in:
parent
01e414e78e
commit
49e7e21626
@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using DiffMatchPatch;
|
||||
using DTLib.Ben.Demystifier;
|
||||
using DTLib.Console;
|
||||
using DTLib.Filesystem;
|
||||
|
||||
@ -9,15 +10,15 @@ namespace diff_text;
|
||||
|
||||
public static class DiffText
|
||||
{
|
||||
internal static void Main(string[] args)
|
||||
internal static int Main(string[] args)
|
||||
{
|
||||
Console.InputEncoding = Encoding.UTF8;
|
||||
Console.OutputEncoding = Encoding.UTF8;
|
||||
|
||||
if (args.Length < 1)
|
||||
{
|
||||
Console.WriteLine("too few arguments, use -h to show help ");
|
||||
return;
|
||||
ColoredConsole.WriteLine("r", "too few arguments, use -h to show help ");
|
||||
return 1;
|
||||
}
|
||||
|
||||
try
|
||||
@ -45,8 +46,11 @@ public static class DiffText
|
||||
{ }
|
||||
catch (Exception ex)
|
||||
{
|
||||
ColoredConsole.WriteLine("r", $"{ex.Message}\n{ex.StackTrace}");
|
||||
ColoredConsole.WriteLine("r", ex.ToStringDemystified());
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static List<Diff> FileDiff(string file0, string file1)
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DTLib.Ben.Demystifier" Version="1.0.4" />
|
||||
<PackageReference Include="google-diff-match-patch" Version="1.3.74" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user