public void AddCommand(ConsoleCommand command) { if (commands.ContainsKey(command.Name)) { throw new InvalidOperationException("Attempt to add existent command"); } commands.Add(command.Name, command); InternalAddCommand(commandTrie, command.Name, command.Name.Length, 0); }
internal void PrintInvalidSyntax(ConsoleCommand cmd) { Msg("{0}Invalid syntax in call to '{1}'", logPrefixProvider.InvalidSyntax, cmd.Name); Msg("{0}Valid arguments: {1}", logPrefixProvider.InvalidSyntax, cmd.Args); }
private void PrintCommandInfo(ConsoleCommand cmd) { Msg("{0} {1}<{2}> {3}", cmd.Name, (cmd.Status != null) ? String.Format("( {0} ) ", cmd.Status) : String.Empty, cmd.Args, cmd.Info); }
public void RemoveCommand(ConsoleCommand command) { if (!commands.ContainsKey(command.Name)) { throw new InvalidOperationException("Attempt to remove nonexistent command"); } RemoveCommand(command.Name); }