using OpenSaveCloudCore.Core;
using System.Reflection;

namespace OpenSaveCloudCli
{
    internal static class Program
    {
        static int Main(string[] args)
        {
            if (args.Contains("-v") || args.Contains("--version"))
            {
                Version();
            }
            return 0;
        }

        static void Version()
        {
            Assembly a = Assembly.GetExecutingAssembly();
            Version? v = a.GetName().Version;
            string clientInfo = "C# [Core .NET {0}/{1}]";
            Version dotNetVersion = Environment.Version;
            string? clrArch = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE");
            clientInfo = string.Format(clientInfo, dotNetVersion, clrArch);

            Console.WriteLine("Open Save Cloud - Terminal Client (Cross Platform)");
            if (v != null)
            {
                Console.WriteLine("v{0}", v.ToString());
            }
            Console.WriteLine("Running on .Net {0}", clientInfo);

            // TODO get server version
        }
    }
}