Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
        public void Execute()
        {
            var s = ToString();

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