diff options
author | Justin Clark-Casey (justincc) | 2012-11-23 01:52:48 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-11-23 01:52:48 +0000 |
commit | eb1921ff930459fa1b6f138f00d0a744feaa157d (patch) | |
tree | 062ab693f5877ee90d11fa37f40050f64939522d /OpenSim/Framework | |
parent | Fix recent windows build break. (diff) | |
download | opensim-SC-eb1921ff930459fa1b6f138f00d0a744feaa157d.zip opensim-SC-eb1921ff930459fa1b6f138f00d0a744feaa157d.tar.gz opensim-SC-eb1921ff930459fa1b6f138f00d0a744feaa157d.tar.bz2 opensim-SC-eb1921ff930459fa1b6f138f00d0a744feaa157d.tar.xz |
Add "help all" console command which will list all commands alphabetically in a single list
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 |