Add possibility to set description and/or data for the default command (#1091)

This commit is contained in:
Cédric Luthi
2023-01-12 13:12:27 +01:00
committed by GitHub
parent f223f6061c
commit 7b9553dd22
6 changed files with 151 additions and 31 deletions

View File

@ -25,11 +25,12 @@ internal sealed class Configurator : IUnsafeConfigurator, IConfigurator, IConfig
Examples.Add(args);
}
public void SetDefaultCommand<TDefaultCommand>()
public ConfiguredCommand SetDefaultCommand<TDefaultCommand>()
where TDefaultCommand : class, ICommand
{
DefaultCommand = ConfiguredCommand.FromType<TDefaultCommand>(
CliConstants.DefaultCommandName, isDefaultCommand: true);
return DefaultCommand;
}
public ICommandConfigurator AddCommand<TCommand>(string name)