diff --git a/Torch/Commands/CommandTree.cs b/Torch/Commands/CommandTree.cs index 4871a72..d67a177 100644 --- a/Torch/Commands/CommandTree.cs +++ b/Torch/Commands/CommandTree.cs @@ -141,6 +141,19 @@ namespace Torch.Commands } } + public bool DeleteNode(CommandNode node) + { + if (node.Parent != null) + { + node.Parent.RemoveNode(node); + return true; + } + if (node.Command?.Path != null) + return _root.Remove(node.Command.Path.First()); + + return false; + } + private void DebugNode(CommandNode commandNode, StringBuilder sb, ref int indent) { sb.AppendLine(new string(' ', indent) + commandNode.Name);