|
1 | | -using System.Reflection; |
| 1 | +using System.Reflection; |
| 2 | +using RT.Util; |
2 | 3 | using RT.Util.Consoles; |
3 | 4 | using RT.Util.ExtensionMethods; |
4 | 5 |
|
@@ -181,14 +182,30 @@ public sealed class InvalidNumericParameterException(string fieldName, Func<int, |
181 | 182 | public InvalidNumericParameterException(string fieldName, Func<int, ConsoleColoredString> helpGenerator) : this(fieldName, helpGenerator, null) { } |
182 | 183 | } |
183 | 184 |
|
184 | | -/// <summary> |
185 | | -/// Indicates that the arguments specified by the user on the command-line do not pass the custom validation check.</summary> |
186 | | -/// <param name="message"> |
187 | | -/// Provide a helpful, descriptive message for the user to determine how to provide a valid command-line parameter.</param> |
188 | | -/// <param name="helpGenerator"> |
189 | | -/// Used internally to generate the help screen; omit if throwing from a validation check.</param> |
| 185 | +/// <summary>Indicates that the arguments specified by the user on the command-line do not pass the custom validation check.</summary> |
190 | 186 | [Serializable] |
191 | | -public sealed class CommandLineValidationException(ConsoleColoredString message, Func<int, ConsoleColoredString> helpGenerator = null) |
192 | | - : CommandLineParseException(message, helpGenerator) |
| 187 | +public sealed class CommandLineValidationException : CommandLineParseException |
193 | 188 | { |
| 189 | + /// <summary>Constructor.</summary> |
| 190 | + internal CommandLineValidationException(ConsoleColoredString message, Func<int, ConsoleColoredString> helpGenerator) : base(message, helpGenerator) { } |
| 191 | + |
| 192 | + /// <summary> |
| 193 | + /// Constructor.</summary> |
| 194 | + /// <param name="message"> |
| 195 | + /// Provide a helpful, descriptive message for the user to determine how to provide a valid command-line parameter.</param> |
| 196 | + public CommandLineValidationException(ConsoleColoredString message) : base(message, null) { } |
| 197 | + |
| 198 | + /// <summary> |
| 199 | + /// Constructor.</summary> |
| 200 | + /// <param name="message"> |
| 201 | + /// Provide a helpful, descriptive message for the user to determine how to provide a valid command-line parameter. |
| 202 | + /// This message is colorized with <see cref="CommandLineParser.Colorize(RhoElement)"/>.</param> |
| 203 | + public CommandLineValidationException(RhoElement message) : base(CommandLineParser.Colorize(message), null) { } |
| 204 | + |
| 205 | + /// <summary> |
| 206 | + /// Constructor.</summary> |
| 207 | + /// <param name="message"> |
| 208 | + /// Provide a helpful, descriptive message for the user to determine how to provide a valid command-line parameter. |
| 209 | + /// This message is colorized with <see cref="CommandLineParser.Colorize(EggsNode)"/>.</param> |
| 210 | + public CommandLineValidationException(EggsNode message) : base(CommandLineParser.Colorize(message), null) { } |
194 | 211 | } |
0 commit comments