diff options
author | Melanie | 2012-11-23 01:49:25 +0000 |
---|---|---|
committer | Melanie | 2012-11-23 01:49:25 +0000 |
commit | 2abddedc3419985ed5cbc4028c2a59a1900c8846 (patch) | |
tree | 5bc7f344edb6732ff1b2a5f93cc8106bbf191222 /OpenSim/Framework | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Add "help all" console command which will list all commands alphabetically in... (diff) | |
download | opensim-SC-2abddedc3419985ed5cbc4028c2a59a1900c8846.zip opensim-SC-2abddedc3419985ed5cbc4028c2a59a1900c8846.tar.gz opensim-SC-2abddedc3419985ed5cbc4028c2a59a1900c8846.tar.bz2 opensim-SC-2abddedc3419985ed5cbc4028c2a59a1900c8846.tar.xz |
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Console/CommandConsole.cs | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs index d1e29b4..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 |