Typin v3.0.0 Release Notes
-
- โ Added
Typin.Core
library. - Core middleware execution order has changed:
ResolveCommandSchemaAndInstance
->InitializeDirectives
->ExecuteDirectivesSubpipeline
-> [Directives subpipeline] ->HandleSpecialOptions
->BindInput
-> [User middlewares] ->ExecuteCommand
. - ๐ Renamed
normal mode
todirect mode
, and added support for custom modes. - ๐ป It is now possible to register multiple exception handleres to handle different exceptions in app.
- ๐ Major API and command execution changes: a) added
ICliApplicationLifetime
,ICliMode
,ICliCommandExecutor
,ICliApplicationLifetime
,DirectMode
,InteractiveMode
,IPipelinedDirective
, and more; b) removedInteractiveCliApplication
. - โ Removed
HandleInteractiveDirective
andHandleInteractiveCommands
middlewares. - ๐ Replaced
IsInteractiveModeOnly
withSupportedModes
andExcludedModes
. - โ Added support for options with no name by automatic conversion of property names.
- โ Added native support for .NET 5.0 (including usage of
init
instead ofget
). - โ Added
Typin.Console.IO
namespace withIStandardInput
,IStandardOuput
,IStandardError
,IStandardOutputAndError
,IStandardRedirectableConsoleStream
,StandardStreamReader
,StandardStreamWriter
. - Rewritten
Typin.Core.Console.ConsoleExtensions
to targetStandardStreamWriter
. - ๐ User middlewares are now executed after command instance creation.
- Middleware types collection in
ApplicationConfiguration
order was reversed. - ๐ Merged
HandleVersionOption
andHandleHelpOption
into one middleware namedHandleSpecialOptions
. - โ Removed unnecessary casts to
CliContext
fromICliContext
. - โ Removed
IDirective.ContinueExecution
, modifiedIDirective
, and addedIPipelinedDirective
. CommandPipelineHandlerDelegate
now usesValueTask
instead of aTask
.- โ Added logging with
Microsoft.Extensions.Logging
(default logger isDebugLogger
). - โ Added
IConsole.ReadKeyAsync()
. - Option name with 3 characters is no longer treated as option alias (e.g.,
--h
is not-h
). - Option name and short name must start with letter (previously not start with digit).
- Parameter names are generated using
StringExtensions.ToHyphenCase()
instead ofstring.ToLowerInvariant()
. - ๐ป Option attributes are validated in ctor, and appropiate exception is thrown without the need of resolving RootSchema.
- โ Added
TextUtils.UnescapeChar()
and a support for the following escape sequences: '\0', '\a', '\b', '\f', '\n', '\r', '\t', '\v', '\\', and Unicode escape e.g. \u006A) during char parsing. - โ Added
CliApplication.RunAsync
with string command line and replacedIReadOnlyList<string>
withIEnumerable<string>
. - Advanced interactive input is disabled when input is redirected.
- โ Added
IRootSchemaAccessor
andIEnvironmentVariablesAccessor
singleton services; - โ Added
ExceptionFormatter
utility and used it as a default exception printer inDefaultExceptionHandler
. - ๐จ
TableUtils
refactory and fix for proper handling of empty collection. [!]
directive is now required only to execute command without parameters and options.- โ Added startup message color personalization, and replaced string formating based on macros with
Func<ApplicationMetadata, string>
andAction<ApplicationMetadata, IConsole>
. - ๐ Fixed case-sensitivity of command and option names (always case-sesitive).
- ๐ Fixed interactive mode autocompletion results (fo 'column chan' TAB TAB result was 'column column change-range' instead of 'column change-range').
- โ Added