static void Help() { foreach (var boi in Terminal.RegisteredCommands) { var help = (Attribute.GetCustomAttribute(boi.Value, typeof(RegisterCommandAttribute)) as RegisterCommandAttribute).Help; CC.WriteLine(string.Format("{0}: {1}", boi.Key.PadRight(16, ' '), help), ConsoleColor.Blue); } }
static void Main(string[] args) { RegisterCommands(); string title = System.Diagnostics.Process.GetCurrentProcess().ProcessName; Console.Title = title; CC.WriteLine($"Welcome to {title}. Type help for a list of commands."); CC.LineBreak(); while (true) { var command = Console.ReadLine(); try { RunCommand(command); } catch (Exception e) { CC.WriteLine("ERROR: " + e.Message, ConsoleColor.Red); } CC.LineBreak(); } }