namespace Neta.Tray;

internal static class Program
{
    [STAThread]
    static void Main(string[] args)
    {
        if (args.Contains("--shutdown"))
        {
            ShutdownCommand.Run(AppContext.BaseDirectory);
            return;
        }

        if (!SingleInstance.TryAcquire())
        {
            ShutdownCommand.OpenExistingInstance();
            return;
        }

        ApplicationConfiguration.Initialize();
        Application.Run(new TrayApplicationContext());
    }
}
