wabbajack/Wabbajack.CLI/VerbRegistration.tt
2022-09-30 19:35:36 -06:00

26 lines
621 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" #>
namespace Wabbajack.CLI;
using Wabbajack.CLI.Verbs;
public partial class CommandLineBuilder {
private static void RegisterAll() {
<#
foreach (var verb in Directory.EnumerateFiles("Verbs"))
{
var klass = verb.Split('\\').Last().Split('.').First();
if (klass == "IVerb") continue;
#>
RegisterCommand<<#=klass#>>(<#=klass#>.Definition, c => ((<#=klass#>)c).Run);
<#
}
#>
}
}