示例#1
0
        public static int Main(string[] args)
        {
            int result = 0;

            try
            {
                if (args != null &&
                    args.Length > 0 &&
                    "-o".Equals(args[0], StringComparison.OrdinalIgnoreCase))
                {
                    CommandParser.Execute(args);
                }
                else
                {
                    ExecuteOldStyle();
                }
                Log.Information("Done!");
            }
            catch (Exception ex)
            {
                HandleException(ex);

                // Return error
                result = 1;
            }
            return(result);
        }
示例#2
0
        public void Server_responds_ERROR_to_invalid_arguments()
        {
            CommandParser parser = new CommandParser();

            string output = parser.Execute(null);

            Assert.AreEqual("ERROR Unsupported command\r\n", output);
        }
示例#3
0
文件: Textbox.cs 项目: mrenow/2D-Game
        public void Execute()
        {
            var s = ToString();

            try {
                CommandParser.Execute(s);
            } catch (Exception e) {
                Console.WriteLine("Error while parsing: \"" + s + "\"");
                Console.WriteLine(e);
            }
            ClearText();
        }