This repository has been archived on 2022-08-05. You can view files and clone it, but cannot push or open issues or pull requests.
UpTool2/UpToolCLI/Program.cs

39 lines
1.1 KiB
C#

using System;
using System.CommandLine;
using UpToolLib;
using UpToolLib.Tool;
namespace UpToolCLI
{
public static class Program
{
private static readonly UtLibFunctions Functions = new UtLibFunctions();
public static int Main(string[] args)
{
MutexLock.Lock();
try
{
XmlTool.FixXml();
ExternalFunctionalityManager.Init(Functions);
RootCommand rootCommand = new RootCommand();
PackageManagement.RegisterCommands(rootCommand);
CacheManagement.RegisterCommands(rootCommand);
ReposManagement.RegisterCommands(rootCommand);
Other.RegisterCommands(rootCommand);
return rootCommand.InvokeAsync(args).Result;
}
catch (Exception e)
{
Console.WriteLine($"FAILED: {e}");
return 1;
}
finally
{
MutexLock.Unlock();
}
}
}
}