54 lines
2.0 KiB
C#
54 lines
2.0 KiB
C#
using Avalonia;
|
|
using gregExtractor.Commands;
|
|
|
|
namespace gregExtractor;
|
|
|
|
public static class Program
|
|
{
|
|
[STAThread]
|
|
public static int Main(string[] args)
|
|
{
|
|
if (args.Length == 0 || string.Equals(args[0], "--gui", StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
|
|
return 0;
|
|
}
|
|
|
|
var app = new CommandApp();
|
|
app.Configure(config =>
|
|
{
|
|
config.SetApplicationName("gregExtractor");
|
|
config.PropagateExceptions();
|
|
config.ValidateExamples();
|
|
|
|
config.AddCommand<ExtractCommand>("extract")
|
|
.WithDescription("Extract hooks from IL2CPP dummy assemblies and generate game_hooks.json");
|
|
|
|
config.AddCommand<CreateCommand>("create")
|
|
.WithDescription("Create a mod scaffold from generated hooks")
|
|
.WithExample("create", "MyEconomyMod", "--type", "harmonyPatch", "--category", "Economy");
|
|
|
|
config.AddCommand<CoverageCommand>("coverage")
|
|
.WithDescription("Analyze implementation coverage against Assembly-CSharp + game_hooks + framework patch sources")
|
|
.WithExample("coverage")
|
|
.WithExample("coverage", "--path", "C:\\Program Files (x86)\\Steam\\steamapps\\common\\Data Center\\MelonLoader\\Il2CppAssemblies")
|
|
.WithExample("coverage", "--sources", ".\\Hooks;.\\framework", "--open");
|
|
|
|
config.AddCommand<SyncCommand>("sync")
|
|
.WithDescription("Synchronize gregCore framework source files with updated Assembly-CSharp hooks")
|
|
.WithExample("sync", "--source", ".\\gregCore\\src", "--dry-run")
|
|
.WithExample("sync", "--source", ".\\gregCore\\src", "--git", "--force");
|
|
});
|
|
|
|
return app.Run(args);
|
|
}
|
|
|
|
public static AppBuilder BuildAvaloniaApp()
|
|
{
|
|
return AppBuilder
|
|
.Configure<GUI.App>()
|
|
.UsePlatformDetect()
|
|
.LogToTrace();
|
|
}
|
|
}
|