Skip to content

Releases: evan-choi/command-line-api-generator

Release 1.3.2

29 Feb 17:43
Compare
Choose a tag to compare

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

29 Feb 17:10
Compare
Choose a tag to compare
v1.3.1

Fix options NRE

Release 1.3.0

29 Feb 16:47
Compare
Choose a tag to compare

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

29 Feb 12:46
Compare
Choose a tag to compare
  • Fix buildTransitive

Release 1.2.0

29 Feb 07:53
b78b0a1
Compare
Choose a tag to compare

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

29 Feb 06:05
Compare
Choose a tag to compare

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>()