Changed IConfigurator to return IConfigurator instead of void for (#1762)

This commit is contained in:
Melvin Dommer
2025-02-24 14:57:23 -06:00
committed by GitHub
parent 11a320c7c9
commit 93668e92b6
3 changed files with 25 additions and 20 deletions

View File

@ -20,22 +20,25 @@ internal sealed class Configurator : IUnsafeConfigurator, IConfigurator, IConfig
Examples = new List<string[]>();
}
public void SetHelpProvider(IHelpProvider helpProvider)
public IConfigurator SetHelpProvider(IHelpProvider helpProvider)
{
// Register the help provider
_registrar.RegisterInstance(typeof(IHelpProvider), helpProvider);
return this;
}
public void SetHelpProvider<T>()
public IConfigurator SetHelpProvider<T>()
where T : IHelpProvider
{
// Register the help provider
_registrar.Register(typeof(IHelpProvider), typeof(T));
return this;
}
public void AddExample(params string[] args)
public IConfigurator AddExample(params string[] args)
{
Examples.Add(args);
return this;
}
public ConfiguredCommand SetDefaultCommand<TDefaultCommand>()