aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Console/CommandConsole.cs
diff options
context:
space:
mode:
authoronefang2019-05-19 21:24:15 +1000
committeronefang2019-05-19 21:24:15 +1000
commit5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch)
treea9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Framework/Console/CommandConsole.cs
parentAdd a build script. (diff)
downloadopensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip
opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz
opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2
opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to 'OpenSim/Framework/Console/CommandConsole.cs')
-rw-r--r--OpenSim/Framework/Console/CommandConsole.cs44
1 files changed, 22 insertions, 22 deletions
diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs
index 0f68afe..52360b4 100644
--- a/OpenSim/Framework/Console/CommandConsole.cs
+++ b/OpenSim/Framework/Console/CommandConsole.cs
@@ -52,27 +52,27 @@ namespace OpenSim.Framework.Console
52 /// The module from which this command comes 52 /// The module from which this command comes
53 /// </value> 53 /// </value>
54 public string module; 54 public string module;
55 55
56 /// <value> 56 /// <value>
57 /// Whether the module is shared 57 /// Whether the module is shared
58 /// </value> 58 /// </value>
59 public bool shared; 59 public bool shared;
60 60
61 /// <value> 61 /// <value>
62 /// Very short BNF description 62 /// Very short BNF description
63 /// </value> 63 /// </value>
64 public string help_text; 64 public string help_text;
65 65
66 /// <value> 66 /// <value>
67 /// Longer one line help text 67 /// Longer one line help text
68 /// </value> 68 /// </value>
69 public string long_help; 69 public string long_help;
70 70
71 /// <value> 71 /// <value>
72 /// Full descriptive help for this command 72 /// Full descriptive help for this command
73 /// </value> 73 /// </value>
74 public string descriptive_help; 74 public string descriptive_help;
75 75
76 /// <value> 76 /// <value>
77 /// The method to invoke for this command 77 /// The method to invoke for this command
78 /// </value> 78 /// </value>
@@ -83,8 +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 all' to get a list of all commands, 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 or type help <item>' where <item> is one of the following:";
88 88
89 /// <value> 89 /// <value>
90 /// Commands organized by keyword in a tree 90 /// Commands organized by keyword in a tree
@@ -106,7 +106,7 @@ namespace OpenSim.Framework.Console
106 { 106 {
107 List<string> help = new List<string>(); 107 List<string> help = new List<string>();
108 List<string> helpParts = new List<string>(cmd); 108 List<string> helpParts = new List<string>(cmd);
109 109
110 // Remove initial help keyword 110 // Remove initial help keyword
111 helpParts.RemoveAt(0); 111 helpParts.RemoveAt(0);
112 112
@@ -154,7 +154,7 @@ namespace OpenSim.Framework.Console
154 154
155 return help; 155 return help;
156 } 156 }
157 157
158 /// <summary> 158 /// <summary>
159 /// See if we can find the requested command in order to display longer help 159 /// See if we can find the requested command in order to display longer help
160 /// </summary> 160 /// </summary>
@@ -171,23 +171,23 @@ namespace OpenSim.Framework.Console
171 help.Insert(0, ItemHelpText); 171 help.Insert(0, ItemHelpText);
172 return help; 172 return help;
173 } 173 }
174 174
175 Dictionary<string, object> dict = tree; 175 Dictionary<string, object> dict = tree;
176 while (helpParts.Count > 0) 176 while (helpParts.Count > 0)
177 { 177 {
178 string helpPart = helpParts[0]; 178 string helpPart = helpParts[0];
179 179
180 if (!dict.ContainsKey(helpPart)) 180 if (!dict.ContainsKey(helpPart))
181 break; 181 break;
182 182
183 //m_log.Debug("Found {0}", helpParts[0]); 183 //m_log.Debug("Found {0}", helpParts[0]);
184 184
185 if (dict[helpPart] is Dictionary<string, Object>) 185 if (dict[helpPart] is Dictionary<string, Object>)
186 dict = (Dictionary<string, object>)dict[helpPart]; 186 dict = (Dictionary<string, object>)dict[helpPart];
187 187
188 helpParts.RemoveAt(0); 188 helpParts.RemoveAt(0);
189 } 189 }
190 190
191 // There was a command for the given help string 191 // There was a command for the given help string
192 if (dict.ContainsKey(String.Empty)) 192 if (dict.ContainsKey(String.Empty))
193 { 193 {
@@ -200,14 +200,14 @@ namespace OpenSim.Framework.Console
200 // If we do have some descriptive help then insert a spacing line before for readability. 200 // If we do have some descriptive help then insert a spacing line before for readability.
201 if (descriptiveHelp != string.Empty) 201 if (descriptiveHelp != string.Empty)
202 help.Add(string.Empty); 202 help.Add(string.Empty);
203 203
204 help.Add(commandInfo.descriptive_help); 204 help.Add(commandInfo.descriptive_help);
205 } 205 }
206 else 206 else
207 { 207 {
208 help.Add(string.Format("No help is available for {0}", originalHelpRequest)); 208 help.Add(string.Format("No help is available for {0}", originalHelpRequest));
209 } 209 }
210 210
211 return help; 211 return help;
212 } 212 }
213 213
@@ -268,7 +268,7 @@ namespace OpenSim.Framework.Console
268// } 268// }
269// return result; 269// return result;
270// } 270// }
271 271
272 /// <summary> 272 /// <summary>
273 /// Add a command to those which can be invoked from the console. 273 /// Add a command to those which can be invoked from the console.
274 /// </summary> 274 /// </summary>
@@ -299,7 +299,7 @@ namespace OpenSim.Framework.Console
299 string[] parts = Parser.Parse(command); 299 string[] parts = Parser.Parse(command);
300 300
301 Dictionary<string, Object> current = tree; 301 Dictionary<string, Object> current = tree;
302 302
303 foreach (string part in parts) 303 foreach (string part in parts)
304 { 304 {
305 if (current.ContainsKey(part)) 305 if (current.ContainsKey(part))
@@ -326,7 +326,7 @@ namespace OpenSim.Framework.Console
326 326
327 return; 327 return;
328 } 328 }
329 329
330 info = new CommandInfo(); 330 info = new CommandInfo();
331 info.module = module; 331 info.module = module;
332 info.shared = shared; 332 info.shared = shared;
@@ -471,7 +471,7 @@ namespace OpenSim.Framework.Console
471 471
472 return null; 472 return null;
473 } 473 }
474 474
475 public bool HasCommand(string command) 475 public bool HasCommand(string command)
476 { 476 {
477 string[] result; 477 string[] result;