diff options
Diffstat (limited to 'OpenSim/Framework/Console')
-rw-r--r-- | OpenSim/Framework/Console/AssemblyInfo.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/Console/CommandConsole.cs | 10 | ||||
-rw-r--r-- | OpenSim/Framework/Console/ConsoleDisplayTable.cs | 15 | ||||
-rw-r--r-- | OpenSim/Framework/Console/ConsoleUtil.cs | 36 |
4 files changed, 42 insertions, 21 deletions
diff --git a/OpenSim/Framework/Console/AssemblyInfo.cs b/OpenSim/Framework/Console/AssemblyInfo.cs index 37c7304..c618454 100644 --- a/OpenSim/Framework/Console/AssemblyInfo.cs +++ b/OpenSim/Framework/Console/AssemblyInfo.cs | |||
@@ -55,4 +55,4 @@ using System.Runtime.InteropServices; | |||
55 | // You can specify all values by your own or you can build default build and revision | 55 | // You can specify all values by your own or you can build default build and revision |
56 | // numbers with the '*' character (the default): | 56 | // numbers with the '*' character (the default): |
57 | 57 | ||
58 | [assembly : AssemblyVersion("0.7.5.*")] | 58 | [assembly : AssemblyVersion("0.7.6.*")] |
diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs index d703d78..9490013 100644 --- a/OpenSim/Framework/Console/CommandConsole.cs +++ b/OpenSim/Framework/Console/CommandConsole.cs | |||
@@ -110,10 +110,11 @@ namespace OpenSim.Framework.Console | |||
110 | // Remove initial help keyword | 110 | // Remove initial help keyword |
111 | helpParts.RemoveAt(0); | 111 | helpParts.RemoveAt(0); |
112 | 112 | ||
113 | help.Add(""); // Will become a newline. | ||
114 | |||
113 | // General help | 115 | // General help |
114 | if (helpParts.Count == 0) | 116 | if (helpParts.Count == 0) |
115 | { | 117 | { |
116 | help.Add(""); // Will become a newline. | ||
117 | help.Add(GeneralHelpText); | 118 | help.Add(GeneralHelpText); |
118 | help.AddRange(CollectAllCommandsHelp()); | 119 | help.AddRange(CollectAllCommandsHelp()); |
119 | } | 120 | } |
@@ -129,6 +130,8 @@ namespace OpenSim.Framework.Console | |||
129 | help.AddRange(CollectHelp(helpParts)); | 130 | help.AddRange(CollectHelp(helpParts)); |
130 | } | 131 | } |
131 | 132 | ||
133 | help.Add(""); // Will become a newline. | ||
134 | |||
132 | return help; | 135 | return help; |
133 | } | 136 | } |
134 | 137 | ||
@@ -199,14 +202,11 @@ namespace OpenSim.Framework.Console | |||
199 | 202 | ||
200 | string descriptiveHelp = commandInfo.descriptive_help; | 203 | string descriptiveHelp = commandInfo.descriptive_help; |
201 | 204 | ||
202 | // If we do have some descriptive help then insert a spacing line before and after for readability. | 205 | // If we do have some descriptive help then insert a spacing line before for readability. |
203 | if (descriptiveHelp != string.Empty) | 206 | if (descriptiveHelp != string.Empty) |
204 | help.Add(string.Empty); | 207 | help.Add(string.Empty); |
205 | 208 | ||
206 | help.Add(commandInfo.descriptive_help); | 209 | help.Add(commandInfo.descriptive_help); |
207 | |||
208 | if (descriptiveHelp != string.Empty) | ||
209 | help.Add(string.Empty); | ||
210 | } | 210 | } |
211 | else | 211 | else |
212 | { | 212 | { |
diff --git a/OpenSim/Framework/Console/ConsoleDisplayTable.cs b/OpenSim/Framework/Console/ConsoleDisplayTable.cs index c620dfe..711a337 100644 --- a/OpenSim/Framework/Console/ConsoleDisplayTable.cs +++ b/OpenSim/Framework/Console/ConsoleDisplayTable.cs | |||
@@ -56,7 +56,7 @@ namespace OpenSim.Framework.Console | |||
56 | public List<ConsoleDisplayTableRow> Rows { get; private set; } | 56 | public List<ConsoleDisplayTableRow> Rows { get; private set; } |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Number of spaces to indent the table. | 59 | /// Number of spaces to indent the whole table. |
60 | /// </summary> | 60 | /// </summary> |
61 | public int Indent { get; set; } | 61 | public int Indent { get; set; } |
62 | 62 | ||
@@ -84,7 +84,7 @@ namespace OpenSim.Framework.Console | |||
84 | Columns.Add(new ConsoleDisplayTableColumn(name, width)); | 84 | Columns.Add(new ConsoleDisplayTableColumn(name, width)); |
85 | } | 85 | } |
86 | 86 | ||
87 | public void AddRow(params string[] cells) | 87 | public void AddRow(params object[] cells) |
88 | { | 88 | { |
89 | Rows.Add(new ConsoleDisplayTableRow(cells)); | 89 | Rows.Add(new ConsoleDisplayTableRow(cells)); |
90 | } | 90 | } |
@@ -113,7 +113,8 @@ namespace OpenSim.Framework.Console | |||
113 | 113 | ||
114 | for (int i = 0; i < Columns.Count; i++) | 114 | for (int i = 0; i < Columns.Count; i++) |
115 | { | 115 | { |
116 | formatSb.Append(' ', TableSpacing); | 116 | if (i != 0) |
117 | formatSb.Append(' ', TableSpacing); | ||
117 | 118 | ||
118 | // Can only do left formatting for now | 119 | // Can only do left formatting for now |
119 | formatSb.AppendFormat("{{{0},-{1}}}", i, Columns[i].Width); | 120 | formatSb.AppendFormat("{{{0},-{1}}}", i, Columns[i].Width); |
@@ -139,16 +140,16 @@ namespace OpenSim.Framework.Console | |||
139 | 140 | ||
140 | public struct ConsoleDisplayTableRow | 141 | public struct ConsoleDisplayTableRow |
141 | { | 142 | { |
142 | public List<string> Cells { get; private set; } | 143 | public List<object> Cells { get; private set; } |
143 | 144 | ||
144 | public ConsoleDisplayTableRow(List<string> cells) : this() | 145 | public ConsoleDisplayTableRow(List<object> cells) : this() |
145 | { | 146 | { |
146 | Cells = cells; | 147 | Cells = cells; |
147 | } | 148 | } |
148 | 149 | ||
149 | public ConsoleDisplayTableRow(params string[] cells) : this() | 150 | public ConsoleDisplayTableRow(params object[] cells) : this() |
150 | { | 151 | { |
151 | Cells = new List<string>(cells); | 152 | Cells = new List<object>(cells); |
152 | } | 153 | } |
153 | } | 154 | } |
154 | } \ No newline at end of file | 155 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Console/ConsoleUtil.cs b/OpenSim/Framework/Console/ConsoleUtil.cs index 16a63e0..97a86a8 100644 --- a/OpenSim/Framework/Console/ConsoleUtil.cs +++ b/OpenSim/Framework/Console/ConsoleUtil.cs | |||
@@ -49,14 +49,14 @@ namespace OpenSim.Framework.Console | |||
49 | = @"Each component of the coord is comma separated. There must be no spaces between the commas. | 49 | = @"Each component of the coord is comma separated. There must be no spaces between the commas. |
50 | If you don't care about the z component you can simply omit it. | 50 | If you don't care about the z component you can simply omit it. |
51 | If you don't care about the x or y components then you can leave them blank (though a comma is still required) | 51 | If you don't care about the x or y components then you can leave them blank (though a comma is still required) |
52 | If you want to specify the maxmimum value of a component then you can use ~ instead of a number | 52 | If you want to specify the maximum value of a component then you can use ~ instead of a number |
53 | If you want to specify the minimum value of a component then you can use -~ instead of a number | 53 | If you want to specify the minimum value of a component then you can use -~ instead of a number |
54 | e.g. | 54 | e.g. |
55 | delete object pos 20,20,20 to 40,40,40 | 55 | show object pos 20,20,20 to 40,40,40 |
56 | delete object pos 20,20 to 40,40 | 56 | delete object pos 20,20 to 40,40 |
57 | delete object pos ,20,20 to ,40,40 | 57 | show object pos ,20,20 to ,40,40 |
58 | delete object pos ,,30 to ,,~ | 58 | delete object pos ,,30 to ,,~ |
59 | delete object pos ,,-~ to ,,30"; | 59 | show object pos ,,-~ to ,,30"; |
60 | 60 | ||
61 | public const string MinRawConsoleVectorValue = "-~"; | 61 | public const string MinRawConsoleVectorValue = "-~"; |
62 | public const string MaxRawConsoleVectorValue = "~"; | 62 | public const string MaxRawConsoleVectorValue = "~"; |
@@ -97,7 +97,7 @@ namespace OpenSim.Framework.Console | |||
97 | if (!UUID.TryParse(rawUuid, out uuid)) | 97 | if (!UUID.TryParse(rawUuid, out uuid)) |
98 | { | 98 | { |
99 | if (console != null) | 99 | if (console != null) |
100 | console.OutputFormat("{0} is not a valid uuid", rawUuid); | 100 | console.OutputFormat("ERROR: {0} is not a valid uuid", rawUuid); |
101 | 101 | ||
102 | return false; | 102 | return false; |
103 | } | 103 | } |
@@ -110,7 +110,7 @@ namespace OpenSim.Framework.Console | |||
110 | if (!uint.TryParse(rawLocalId, out localId)) | 110 | if (!uint.TryParse(rawLocalId, out localId)) |
111 | { | 111 | { |
112 | if (console != null) | 112 | if (console != null) |
113 | console.OutputFormat("{0} is not a valid local id", localId); | 113 | console.OutputFormat("ERROR: {0} is not a valid local id", localId); |
114 | 114 | ||
115 | return false; | 115 | return false; |
116 | } | 116 | } |
@@ -118,7 +118,7 @@ namespace OpenSim.Framework.Console | |||
118 | if (localId == 0) | 118 | if (localId == 0) |
119 | { | 119 | { |
120 | if (console != null) | 120 | if (console != null) |
121 | console.OutputFormat("{0} is not a valid local id - it must be greater than 0", localId); | 121 | console.OutputFormat("ERROR: {0} is not a valid local id - it must be greater than 0", localId); |
122 | 122 | ||
123 | return false; | 123 | return false; |
124 | } | 124 | } |
@@ -150,10 +150,30 @@ namespace OpenSim.Framework.Console | |||
150 | } | 150 | } |
151 | 151 | ||
152 | if (console != null) | 152 | if (console != null) |
153 | console.OutputFormat("{0} is not a valid UUID or local id", rawId); | 153 | console.OutputFormat("ERROR: {0} is not a valid UUID or local id", rawId); |
154 | 154 | ||
155 | return false; | 155 | return false; |
156 | } | 156 | } |
157 | |||
158 | /// <summary> | ||
159 | /// Convert a minimum vector input from the console to an OpenMetaverse.Vector3 | ||
160 | /// </summary> | ||
161 | /// <param name='console'>Can be null if no console is available.</param> | ||
162 | /// <param name='rawConsoleVector'>/param> | ||
163 | /// <param name='vector'></param> | ||
164 | /// <returns></returns> | ||
165 | public static bool TryParseConsoleInt(ICommandConsole console, string rawConsoleInt, out int i) | ||
166 | { | ||
167 | if (!int.TryParse(rawConsoleInt, out i)) | ||
168 | { | ||
169 | if (console != null) | ||
170 | console.OutputFormat("ERROR: {0} is not a valid integer", rawConsoleInt); | ||
171 | |||
172 | return false; | ||
173 | } | ||
174 | |||
175 | return true; | ||
176 | } | ||
157 | 177 | ||
158 | /// <summary> | 178 | /// <summary> |
159 | /// Convert a minimum vector input from the console to an OpenMetaverse.Vector3 | 179 | /// Convert a minimum vector input from the console to an OpenMetaverse.Vector3 |