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); }
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); }
public void Execute() { var s = ToString(); try { CommandParser.Execute(s); } catch (Exception e) { Console.WriteLine("Error while parsing: \"" + s + "\""); Console.WriteLine(e); } ClearText(); }