public ConsoleManager(Blackboard blk, Kernel kernel, ConsoleLogWriter log) { this.kernel = kernel; this.blackboard = blk; this.log = log; this.currentLine = String.Empty; this.tabSw = new Stopwatch(); this.firstTab = false; this.history = new CommandHistoryManager(); this.completionTree = new CompletionTree(); this.kernel.ConsoleManager = this; this.kernel.FillCompletionTree(this.completionTree); }
internal void FillCompletionTree(CompletionTree completionTree) { foreach (string command in this.commands.Keys) { completionTree.AddWord(command); completionTree.AddWord(String.Format("help {0}", command)); } foreach (IModuleClient m in this.blackboard.Modules) { if (m == this.blackboard.VirtualModule) { continue; } // completionTree.AddWord("list " + m.Name + " commands"); completionTree.AddWord("info " + m.Name); completionTree.AddWord("sim " + m.Name); completionTree.AddWord("proc check " + m.Name); completionTree.AddWord("proc close " + m.Name); completionTree.AddWord("proc kill " + m.Name); completionTree.AddWord("proc launch " + m.Name); completionTree.AddWord("proc restart " + m.Name); completionTree.AddWord("proc start " + m.Name); // completionTree.AddWord("put " + m.Name); foreach (IPrototype proto in m.Prototypes) { string par = proto.ParamsRequired ? " \"0\"" : String.Empty; //completionTree.AddWord(String.Format("put {0} {1}{2}", m.Name, proto.Command, par)); completionTree.AddWord(String.Format("put {0}{1}", proto.Command, par)); } } completionTree.AddWord("list modules"); completionTree.AddWord("list commands"); completionTree.AddWord("list vars"); foreach (SharedVariable sv in this.blackboard.VirtualModule.SharedVariables) { completionTree.AddWord("cat " + sv.Name); completionTree.AddWord("read " + sv.Name); completionTree.AddWord("trace " + sv.Name); } }
internal void FillCompletionTree(CompletionTree completionTree) { foreach (string command in this.commands.Keys) { completionTree.AddWord(command); completionTree.AddWord(String.Format("help {0}", command)); } foreach (IModuleClient m in this.blackboard.Modules) { if (m == this.blackboard.VirtualModule) continue; // completionTree.AddWord("list " + m.Name + " commands"); completionTree.AddWord("info " + m.Name); completionTree.AddWord("sim " + m.Name); completionTree.AddWord("proc check " + m.Name); completionTree.AddWord("proc close " + m.Name); completionTree.AddWord("proc kill " + m.Name); completionTree.AddWord("proc launch " + m.Name); completionTree.AddWord("proc restart " + m.Name); completionTree.AddWord("proc start " + m.Name); // completionTree.AddWord("put " + m.Name); foreach (IPrototype proto in m.Prototypes) { string par = proto.ParamsRequired ? " \"0\"" : String.Empty; //completionTree.AddWord(String.Format("put {0} {1}{2}", m.Name, proto.Command, par)); completionTree.AddWord(String.Format("put {0}{1}", proto.Command, par)); } } completionTree.AddWord("list modules"); completionTree.AddWord("list commands"); completionTree.AddWord("list vars"); foreach (SharedVariable sv in this.blackboard.VirtualModule.SharedVariables) { completionTree.AddWord("cat " + sv.Name); completionTree.AddWord("read " + sv.Name); completionTree.AddWord("trace " + sv.Name); } }