Update version

This commit is contained in:
Tyrrrz
2020-12-06 18:42:58 +02:00
parent ac01c2aecb
commit 90a01e729b
3 changed files with 9 additions and 3 deletions

View File

@@ -1,3 +1,9 @@
### v1.6 (06-Dec-2020)
- Added support for custom value validators. You can now create a type that inherits from `CliFx.ArgumentValueValidator<T>` to implement reusable validation logic for command arguments. To use a validator, include it in the `Validators` property on the `CommandOption` or `CommandParameter` attribute. (Thanks [@Oleksandr Shustov](https://github.com/AlexandrShustov))
- Added `CliFx.ArgumentValueConverter<T>` class that you can inherit from to implement custom value converters. `CliFx.IArgumentValueConverter` interface is still available, but it is recommended to inherit from the generic class instead, due to the type safety it provides. The interface may become internal or get removed in one of the future major versions.
- Updated requirements for option names and short names: short names now must be letter characters (lowercase or uppercase), while names must now start with a letter character. This means option names can no longer start with a digit or a special character. This change makes it possible to pass negative number values without the need to quote them, i.e. `--my-number -5`.
### v1.5 (23-Oct-2020) ### v1.5 (23-Oct-2020)
- Added pretty-printing for unhandled exceptions thrown from within the application. This makes the errors easier to parse visually and should help in troubleshooting. This change does not affect `CommandException`, as it already has special treatment. (Thanks [@Mårten Åsberg](https://github.com/89netraM)) - Added pretty-printing for unhandled exceptions thrown from within the application. This makes the errors easier to parse visually and should help in troubleshooting. This change does not affect `CommandException`, as it already has special treatment. (Thanks [@Mårten Åsberg](https://github.com/89netraM))

View File

@@ -1,7 +1,7 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<Version>1.5</Version> <Version>1.6</Version>
<Company>Tyrrrz</Company> <Company>Tyrrrz</Company>
<Copyright>Copyright (C) Alexey Golub</Copyright> <Copyright>Copyright (C) Alexey Golub</Copyright>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>

View File

@@ -264,9 +264,9 @@ When defining a parameter of an enumerable type, keep in mind that it has to be
```c# ```c#
// Maps 2D vectors from AxB notation // Maps 2D vectors from AxB notation
public class VectorConverter : IArgumentValueConverter public class VectorConverter : ArgumentValueConverter<Vector2>
{ {
public object ConvertFrom(string value) public override Vector2 ConvertFrom(string value)
{ {
var components = value.Split('x', 'X', ';'); var components = value.Split('x', 'X', ';');
var x = int.Parse(components[0], CultureInfo.InvariantCulture); var x = int.Parse(components[0], CultureInfo.InvariantCulture);