static void Main(string[] args) { Server server = new Server(); var hasArg = args.Length > 0; var arg = hasArg ? args[0] : null; if (hasArg && args[0] == "selftest") { VerificationTask.SelfTest(); } else if (hasArg && File.Exists(arg)) { Console.WriteLine("# Reading from {0}", Path.GetFileName(arg)); Console.SetIn(new StreamReader(arg, Encoding.UTF8)); server.Loop(); } else { server.Loop(); } }