Merge branch 'master' into careminster
commit
2abddedc34
|
@ -83,7 +83,8 @@ namespace OpenSim.Framework.Console
|
||||||
= "To enter an argument that contains spaces, surround the argument with double quotes.\nFor example, show object name \"My long object name\"\n";
|
= "To enter an argument that contains spaces, surround the argument with double quotes.\nFor example, show object name \"My long object name\"\n";
|
||||||
|
|
||||||
public const string ItemHelpText
|
public const string ItemHelpText
|
||||||
= "For more information, type 'help <item>' where <item> is one of the following:";
|
= @"For more information, type 'help all' to get a list of all commands,
|
||||||
|
or type help <item>' where <item> is one of the following:";
|
||||||
|
|
||||||
/// <value>
|
/// <value>
|
||||||
/// Commands organized by keyword in a tree
|
/// Commands organized by keyword in a tree
|
||||||
|
@ -117,6 +118,10 @@ namespace OpenSim.Framework.Console
|
||||||
help.Add(ItemHelpText);
|
help.Add(ItemHelpText);
|
||||||
help.AddRange(CollectModulesHelp(tree));
|
help.AddRange(CollectModulesHelp(tree));
|
||||||
}
|
}
|
||||||
|
else if (helpParts.Count == 1 && helpParts[0] == "all")
|
||||||
|
{
|
||||||
|
help.AddRange(CollectAllCommandsHelp());
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
help.AddRange(CollectHelp(helpParts));
|
help.AddRange(CollectHelp(helpParts));
|
||||||
|
@ -125,6 +130,28 @@ namespace OpenSim.Framework.Console
|
||||||
return help;
|
return help;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Collects the help from all commands and return in alphabetical order.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
private List<string> CollectAllCommandsHelp()
|
||||||
|
{
|
||||||
|
List<string> help = new List<string>();
|
||||||
|
|
||||||
|
lock (m_modulesCommands)
|
||||||
|
{
|
||||||
|
foreach (List<CommandInfo> commands in m_modulesCommands.Values)
|
||||||
|
{
|
||||||
|
var ourHelpText = commands.ConvertAll(c => string.Format("{0} - {1}", c.help_text, c.long_help));
|
||||||
|
help.AddRange(ourHelpText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
help.Sort();
|
||||||
|
|
||||||
|
return help;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// See if we can find the requested command in order to display longer help
|
/// See if we can find the requested command in order to display longer help
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue