예제 #1
0
        public static void OnCommandLineException(object sender, CommandLineExceptionEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("e");
            }

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine(e.Exception.Message);
            Console.ResetColor();

            ICommandLine commandLine = sender as ICommandLine;

            if (commandLine != null)
            {
                commandLine.Terminate();
            }

            Environment.Exit(0);
        }