Releases: evan-choi/command-line-api-generator
Releases · evan-choi/command-line-api-generator
Release 1.3.2
Support multiple referenced command!
[RootCommand(Subcommands = new[] { typeof(SubCommand) })]
class CommandA
{
}
[RootCommand(Subcommands = new[] { typeof(SubCommand) })]
class CommandB
{
}
[Command("sub")]
class SubCommand
{
}
Release 1.3.1
v1.3.1 Fix options NRE
Release 1.3.0
Add Command Options
You don't need to set up a Handler
property.
[RootCommand]
class AppCommand
{
}
class AppCommandHandler : ICommandHandler<AppCommand>
{
...
}
You can lazy set Handler
with Options class.
var options = new AppCommandOptions
{
Handler = new AppCommandHandler()
};
var command = AppCommandFactory.Create(options);
Release 1.2.1
- Fix
buildTransitive
Release 1.2.0
Add Subcommands
to CommandAttribute
[RootCommand(
Subcommands = new[]
{
typeof(SubCommand)
}
)]
public class MainCommand
{
}
[Command(
"config",
Subcommands = new[]
{
typeof(ConfigGetCommand)
}
)]
public class ConfigCommand
{
}
[Command("get")]
public class ConfigGetCommand
{
// ..
}
Release 1.1.0
Support GenericCommand
[RootCommand(Handler = typeof(MainCommandHandler<>))]
class MainCommand<T>
{
}
class MainCommandHandler<T> : ICommandHandler<MainCommand<T>>
{
public Task<int> InvokeAsync(MainCommand<T> command)
{
}
}
Factory
MainCommandFactory.Create<T>()