Example #1
0
        private static void Main(string[] args)
        {
#if DEBUG
            args = new[] { "compress", "inp.zip", "out.zip.gz" };
            File.Delete("out.zip.gz");
#endif
//#if DEBUG
//            args = new[] { "decompress", "Backups.zip.gz", "BackupsOut.zip" };
//            File.Delete("BackupsOut.zip");
//#endif
            AddUnhandledExceptionHandler();
            AddCancelKeyHandler();

            try
            {
                var par = Parameters.Parse(args);
                _app = new ArchivistApp(par);
                _app.Run();
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex.Message);
                _app?.Exit();
#if DEBUG
                Console.ReadKey();
#endif
                Environment.Exit(1);
            }
            MessageSystem.GetMessages().ToList().ForEach(Console.WriteLine);
            _app.Exit();
#if DEBUG
            Console.ReadKey();
#endif
        }