diff --git a/Changelog.md b/Changelog.md index 0694779..f90531b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,37 @@ +### v2.0 (21-Mar-2021) + +> Note: this major release includes many breaking changes. +Please refer to the readme to find updated instructions and usage examples. + +- Renamed property `EnvironmentVariableName` to `EnvironmentVariable` on `CommandOption` attribute. +- Removed most of schema validation checks that used to take place during application startup. Going forward, CliFx will be relying solely on its built-in set of Roslyn analyzers to catch common errors in command configuration. +- Removed `ProgressTicker` utility. The recommended migration path is to use the [Spectre.Console](https://github.com/spectresystems/spectre.console) library which provides a wide array of console widgets and components. See [this wiki page](https://github.com/Tyrrrz/CliFx/wiki/Integrating-with-Spectre.Console) to learn how to integrate Spectre.Console with CliFx. +- Removed `MemoryStreamWriter` utility as it's no longer used within CliFx. +- Improved wording in all error messages. +- Renamed some methods on `CliApplicationBuilder`: + - `UseTitle()` renamed to `SetTitle()` + - `UseExecutableName()` renamed to `SetExecutableName()` + - `UseVersionText()` renamed to `SetVersion()` + - `UseDescription()` renamed to `SetDescription()` +- Changed the behavior of autogenerated help text: + - Changed the color scheme to a more neutral set of tones + - Assigned separate colors to parameters and options to make them visually stand out + - Usage section no longer lists usage formats of all descendant commands + - Command section now also lists available subcommands for each of the current command's subcommands +- Changed the behavior of `[preview]` directive. Running the application with this directive will now also print all resolved environment variables, in addition to parsed command line arguments. +- Reworked `IArgumentValueConverter`/`ArgumentValueConverter` into `BindingConverter`. Method `ConvertFrom(...)` has been renamed to `Convert(...)`. +- Reworked `ArgumentValueValidator` into `BindingValidator`. This class exposes an abstract `Validate(...)` method that returns a nullable `BindingValidationError`. This class also provides utility methods `Ok()` and `Error(...)` to help create corresponding validation results. +- Changed the type of `IConsole.Output` and `IConsole.Error` from `StreamWriter` to `ConsoleWriter`. This type derives from `StreamWriter` and additionally exposes a `Console` property that refers to the console instance that owns the stream. This change enables you to author extension methods scoped specifically to console output and error streams. +- Changed the type of `IConsole.Input` from `StreamReader` to `ConsoleReader`. This type derives from `StreamReader` and additionally exposes a `Console` property that refers to the console instance that owns the stream. This change enables you to author extension methods scoped specifically to the console input stream. +- Changed methods `IConsole.WithForegroundColor(...)`, `IConsole.WithBackgroundColor(...)`, and `IConsole.WithColors(...)` to return `IDisposable`, replacing the delegate parameter they previously had. You can wrap the returned `IDisposable` in a using statement to ensure that the console colors get reset back to their original values once the execution reaches the end of the block. +- Renamed `IConsole.GetCancellationToken()` to `IConsole.RegisterCancellationHandler()`. +- Reworked `VirtualConsole` into `FakeConsole`. This class no longer takes `CancellationToken` as a constructor parameter, but instead encapsulates its own instance of `CancellationTokenSource` that can be triggered using the provided `RequestCancellation()` method. +- Removed `VirtualConsole.CreateBuffered()` and replaced it with the `FakeInMemoryConsole` class. This class derives from `FakeConsole` and uses in-memory standard input, output, and error streams. It also provides methods to easily read the data written to the streams. +- Moved some types to different namespaces: + - `IConsole`/`FakeConsole`/`FakeInMemoryConsole` moved from `CliFx` to `CliFx.Infrastructure` + - `ITypeActivator`/`DefaultTypeActivator`/`DelegateTypeActivator` moved from `CliFx` to `CliFx.Infrastructure` + - `BindingValidator`/`BindingConverter` moved from `CliFx` to `CliFx.Extensibility` + ### v1.6 (06-Dec-2020) - Added support for custom value validators. You can now create a type that inherits from `CliFx.ArgumentValueValidator` 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)) @@ -17,7 +51,7 @@ ### v1.3.2 (31-Jul-2020) -- Fixed an issue where a command was incorrectly allowed to execute when the user did not specify any value for a non-scalar parameter. Since they are always required, a parameter needs to be bound to (at least) one value. (Thanks [@Daniel Hix](https://github.com/ADustyOldMuffin)) +- Fixed an issue where a command was incorrectly allowed to execute when the user did not specify any value for a non-scalar parameter. Since they are always required, a parameter needs to be bound to at least one value. (Thanks [@Daniel Hix](https://github.com/ADustyOldMuffin)) - Fixed an issue where `CliApplication.RunAsync(...)` threw `ArgumentException` if there were two environment variables, whose names differed only in case. Environment variable names are now treated case-sensitively. (Thanks [@Ron Myers](https://github.com/ron-myers)) ### v1.3.1 (19-Jul-2020) diff --git a/Directory.Build.props b/Directory.Build.props index 7fe476d..276feeb 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 1.6 + 2.0 Tyrrrz Copyright (C) Alexey Golub latest