Allow the user to enter help topics in upper or lowercase.
Forcing uppercase (e.g. help Assets) is too annoying. Thanks to WhiteStar for pointing this out.0.7.3-extended
parent
bcfe48e05b
commit
f85a453dc8
|
@ -188,19 +188,21 @@ namespace OpenSim.Framework.Console
|
||||||
{
|
{
|
||||||
lock (m_modulesCommands)
|
lock (m_modulesCommands)
|
||||||
{
|
{
|
||||||
if (m_modulesCommands.ContainsKey(moduleName))
|
foreach (string key in m_modulesCommands.Keys)
|
||||||
{
|
{
|
||||||
List<CommandInfo> commands = m_modulesCommands[moduleName];
|
// Allow topic help requests to succeed whether they are upper or lowercase.
|
||||||
|
if (moduleName.ToLower() == key.ToLower())
|
||||||
|
{
|
||||||
|
List<CommandInfo> commands = m_modulesCommands[key];
|
||||||
var ourHelpText = commands.ConvertAll(c => string.Format("{0} - {1}", c.help_text, c.long_help));
|
var ourHelpText = commands.ConvertAll(c => string.Format("{0} - {1}", c.help_text, c.long_help));
|
||||||
ourHelpText.Sort();
|
ourHelpText.Sort();
|
||||||
helpText.AddRange(ourHelpText);
|
helpText.AddRange(ourHelpText);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -244,15 +244,16 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
string capitalizedTopic = char.ToUpper(topic[0]) + topic.Substring(1);
|
string capitalizedTopic = char.ToUpper(topic[0]) + topic.Substring(1);
|
||||||
|
|
||||||
|
// This is a hack to allow the user to enter the help command in upper or lowercase. This will go
|
||||||
|
// away at some point.
|
||||||
|
m_console.Commands.AddCommand(capitalizedTopic, false, "help " + topic,
|
||||||
|
"help " + capitalizedTopic,
|
||||||
|
"Get help on plugin command '" + topic + "'",
|
||||||
|
HandleCommanderHelp);
|
||||||
m_console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic,
|
m_console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic,
|
||||||
"help " + capitalizedTopic,
|
"help " + capitalizedTopic,
|
||||||
"Get help on plugin command '" + topic + "'",
|
"Get help on plugin command '" + topic + "'",
|
||||||
HandleCommanderHelp);
|
HandleCommanderHelp);
|
||||||
//
|
|
||||||
// m_console.Commands.AddCommand("General", false, topic,
|
|
||||||
// topic,
|
|
||||||
// "Execute subcommand for plugin '" + topic + "'",
|
|
||||||
// null);
|
|
||||||
|
|
||||||
ICommander commander = null;
|
ICommander commander = null;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue