mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
29 lines
785 B
Plaintext
29 lines
785 B
Plaintext
|
<#@ template language="C#v3.5" #>
|
||
|
<#@ assembly name="System.Core" #>
|
||
|
<#@ import namespace="System.Text" #>
|
||
|
<#@ import namespace="System.Linq" #>
|
||
|
<#@ import namespace="System.IO"#>
|
||
|
<#@ import namespace="System.Collections.Generic" #>
|
||
|
|
||
|
using Microsoft.Extensions.DependencyInjection;
|
||
|
namespace Wabbajack;
|
||
|
using Wabbajack.Verbs;
|
||
|
using Wabbajack.CLI.Builder;
|
||
|
|
||
|
public static class CommandLineBuilderExtensions{
|
||
|
|
||
|
public static void AddCLIVerbs(this IServiceCollection services) {
|
||
|
<#
|
||
|
foreach (var verb in Directory.EnumerateFiles("Verbs"))
|
||
|
{
|
||
|
var klass = verb.Split('\\').Last().Split('.').First();
|
||
|
if (klass == "IVerb") continue;
|
||
|
#>
|
||
|
CommandLineBuilder.RegisterCommand<<#=klass#>>(<#=klass#>.Definition, c => ((<#=klass#>)c).Run);
|
||
|
services.AddSingleton<<#=klass#>>();
|
||
|
<#
|
||
|
}
|
||
|
|
||
|
#>
|
||
|
}
|
||
|
}
|