Releases: xo-energy/XO.Console.Cli
Releases · xo-energy/XO.Console.Cli
v5.0.56
What's Changed
- Add net8.0 targets and update dependencies by @wjrogers in #9
- Replace runtime reflection with compile-time source generator by @wjrogers in #8
Breaking Changes
- For a given command, declarative configuration with
CommandAttribute
and imperative configuration withICommandBuilder
are mutually exclusive.CommandAttribute
automatically adds the target command type to the application, and it has new properties that provide access to all command configuration options. (You can still mix declarative and imperative configuration of different commands in the same application. Be sure to omitCommandAttribute
from any type you want to configure through the builder.) - Instead of using
DescriptionAttribute
to set the help text for commands, arguments, and options, use theDescription
property ofCommandAttribute
,CommandArgumentAttribute
, andCommandOptionAttribute
, respectively. - Support for typed global options has been removed.
ICommandContext
provides access to the rawstring
values of global options. - Some infrastructure types have been moved, renamed, or deleted.
Packages
- XO.Console.Cli v5.0.42
- XO.Console.Cli.Extensions v5.0.9
- XO.Console.Cli.Instrumentation v5.0.6
Full Changelog: v4.0.3...v5.0.56
v4.0.3
What's Changed
- Replace complicated reflection-based middleware support w/ interface by @wjrogers in #4
- Add XO.Console.Cli.Instrumentation with support for OpenTelemetry by @wjrogers in #6
- Expose
ParseResult
as a property ofICommandContext
(#3) - Don't swallow exceptions in hosting extension methods (#5)
Full Changelog: v3.0.7...v4.0.3
Packages
v3.0.7
v2.0.10
v2.0.5
Changes
Breaking change: CommandContext
implements IAsyncDisposable
and IDisposable
. Callers of CommandApp.Bind()
must dispose the returned context to release its service scope. (The all-in-one ExecuteAsync(string[], CancellationToken)
extension method does this for you.)
- Support scoped dependency resolution by creating a new service scope in
CommandApp.Bind()
and using it to resolve the command and parameters instances - Add a scoped dependency resolution abstraction:
- Implementations of
ITypeResolver
may, optionally, also implementITypeResolverScopeFactory
- If possible,
CommandApp
callsITypeResolverScopeFactory.CreateScope()
to get an instance ofITypeResolverScope
- The scoped
ITypeResolver
instance is exposed asCommandContext.CommandServices
for use by middleware
- Implementations of
- Implement
ITypeResolverScopeFactory
inXO.Console.Cli.Extensions
for seamless integration withMicrosoft.Extensions.DependencyInjection
Full Changelog: v1.1.4...v2.0.5