private void PrintArgs(string[] args) { foreach (var item in args) { CommandLineCore.Print(item); } }
public override void Help() { StringBuilder helpMessage = new StringBuilder(); helpMessage.AppendLine("example"); helpMessage.Append("printargs string:messageToPrint"); CommandLineCore.Print(helpMessage.ToString()); }
public virtual void Help() { StringBuilder builder = new StringBuilder(); int counter = 0; foreach (var item in commands) { builder.Append(item.Key); counter++; if (counter < commands.Count) { builder.Append("\n"); } } CommandLineCore.Print(builder.ToString()); }
public void Execute(string[] args) { try { string command = args[1].ToLower(); if (args[0].ToLower() == "h" || args[0].ToLower() == "-h" || args[0].ToLower() == "help" || command == "h" || command == "-h" || command == "help") { Help(); } else if (commands.ContainsKey(command)) { commands[command](args); } } catch (System.Exception e) { CommandLineCore.PrintError(e.ToString()); } }
private void SomeMethod(string[] args) { Debug.Log("SomeMethod() was called"); CommandLineCore.Print("This is an example message."); }