From 732cd838b1ce2bc5d2c312f510818fd63db76be4 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 5 Feb 2009 21:35:59 +0000 Subject: * Make existing module commanders register as help topics * Typing help will now give a list of these topics at the top (as well as the rest of the current help stuff) * Typing help will give information about commands specific to that topic --- OpenSim/Framework/Servers/BaseOpenSimServer.cs | 28 ++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'OpenSim/Framework/Servers') diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 4d82020..473991a 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -104,6 +104,16 @@ namespace OpenSim.Framework.Servers /// Should be overriden and referenced by descendents if they need to perform extra shutdown processing /// public virtual void ShutdownSpecific() {} + + /// + /// Provides a list of help topics that are available. Overriding classes should append their topics to the + /// information returned when the base method is called. + /// + /// + /// + /// A list of strings that represent different help topics on which more information is available + /// + protected virtual List GetHelpTopics() { return new List(); } /// /// Print statistics to the logfile, if they are active @@ -310,11 +320,20 @@ namespace OpenSim.Framework.Servers /// protected virtual void ShowHelp(string[] helpArgs) { + Notice(""); + if (helpArgs.Length == 0) { - Notice(""); - // TODO: not yet implemented - //Notice("help [command] - display general help or specific command help. Try help help for more info."); + List helpTopics = GetHelpTopics(); + + if (helpTopics.Count > 0) + { + Notice( + "As well as the help information below, you can also type help to get more information on the following areas:"); + Notice(string.Format(" {0}", string.Join(", ", helpTopics.ToArray()))); + Notice(""); + } + Notice("quit - equivalent to shutdown."); Notice("set log level [level] - change the console logging level only. For example, off or debug."); @@ -326,7 +345,8 @@ namespace OpenSim.Framework.Servers Notice("show threads - list tracked threads"); Notice("show uptime - show server startup time and uptime."); Notice("show version - show server version."); - Notice("shutdown - shutdown the server.\n"); + Notice("shutdown - shutdown the server."); + Notice(""); return; } -- cgit v1.1