aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Console/CommandConsole.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Console/CommandConsole.cs')
-rw-r--r--OpenSim/Framework/Console/CommandConsole.cs31
1 files changed, 29 insertions, 2 deletions
diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs
index bd23d1c..de30414 100644
--- a/OpenSim/Framework/Console/CommandConsole.cs
+++ b/OpenSim/Framework/Console/CommandConsole.cs
@@ -83,7 +83,8 @@ namespace OpenSim.Framework.Console
83 = "To enter an argument that contains spaces, surround the argument with double quotes.\nFor example, show object name \"My long object name\"\n"; 83 = "To enter an argument that contains spaces, surround the argument with double quotes.\nFor example, show object name \"My long object name\"\n";
84 84
85 public const string ItemHelpText 85 public const string ItemHelpText
86 = "For more information, type 'help <item>' where <item> is one of the following:"; 86= @"For more information, type 'help all' to get a list of all commands,
87 or type help <item>' where <item> is one of the following:";
87 88
88 /// <value> 89 /// <value>
89 /// Commands organized by keyword in a tree 90 /// Commands organized by keyword in a tree
@@ -117,6 +118,10 @@ namespace OpenSim.Framework.Console
117 help.Add(ItemHelpText); 118 help.Add(ItemHelpText);
118 help.AddRange(CollectModulesHelp(tree)); 119 help.AddRange(CollectModulesHelp(tree));
119 } 120 }
121 else if (helpParts.Count == 1 && helpParts[0] == "all")
122 {
123 help.AddRange(CollectAllCommandsHelp());
124 }
120 else 125 else
121 { 126 {
122 help.AddRange(CollectHelp(helpParts)); 127 help.AddRange(CollectHelp(helpParts));
@@ -124,6 +129,28 @@ namespace OpenSim.Framework.Console
124 129
125 return help; 130 return help;
126 } 131 }
132
133 /// <summary>
134 /// Collects the help from all commands and return in alphabetical order.
135 /// </summary>
136 /// <returns></returns>
137 private List<string> CollectAllCommandsHelp()
138 {
139 List<string> help = new List<string>();
140
141 lock (m_modulesCommands)
142 {
143 foreach (List<CommandInfo> commands in m_modulesCommands.Values)
144 {
145 var ourHelpText = commands.ConvertAll(c => string.Format("{0} - {1}", c.help_text, c.long_help));
146 help.AddRange(ourHelpText);
147 }
148 }
149
150 help.Sort();
151
152 return help;
153 }
127 154
128 /// <summary> 155 /// <summary>
129 /// See if we can find the requested command in order to display longer help 156 /// See if we can find the requested command in order to display longer help
@@ -711,7 +738,7 @@ namespace OpenSim.Framework.Console
711 /// </summary> 738 /// </summary>
712 public void Prompt() 739 public void Prompt()
713 { 740 {
714 string line = ReadLine(m_defaultPrompt + "# ", true, true); 741 string line = ReadLine(DefaultPrompt + "# ", true, true);
715 742
716 if (line != String.Empty) 743 if (line != String.Empty)
717 Output("Invalid command"); 744 Output("Invalid command");