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