static void Main(string[] args)
        {
            try
            {
                AppDomain.CurrentDomain.DomainUnload += CleanupBeforeExit;
                var parsed = Args.Parse <Options>(args);
                if (parsed.Debug)
                {
                    Debugger.Launch();
                }
                var success = new UnityPackageMetadataProvider().Extract(parsed);
                if (success)
                {
                    Console.WriteLine(Environment.NewLine + "Successfully extracted");
                }
            }
            catch (ArgException ex)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("Invalid cmd line arguments: " + ex.Message + Environment.NewLine);
                Console.ResetColor();

                ArgUsage.GetStyledUsage <Options>().Write();
            }
            catch (Exception ex)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine(Environment.NewLine + "An error occurred while extracting: " + ex.Message + Environment.NewLine);
                Console.ResetColor();
            }
            Console.ResetColor();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            try
            {
                AppDomain.CurrentDomain.DomainUnload += CleanupBeforeExit;
                var parsed = Args.Parse<Options>(args);
                if (parsed.Debug)
                {
                    Debugger.Launch();
                }
                var success = new UnityPackageMetadataProvider().Extract(parsed);
                if (success)
                {
                    Console.WriteLine(Environment.NewLine + "Successfully extracted");
                }

            }
            catch (ArgException ex)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("Invalid cmd line arguments: " + ex.Message + Environment.NewLine);
                Console.ResetColor();

                ArgUsage.GetStyledUsage<Options>().Write();
            }
            catch (Exception ex)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine(Environment.NewLine + "An error occurred while extracting: " + ex.Message + Environment.NewLine);
                Console.ResetColor();
            }
            Console.ResetColor();
        }