Il progetto adotta il nome «Rail Enterprise» ovunque (codice RailEnterprise.*, variabili RE_*, intestazioni RESV/RECL, immagine rail-enterprise-server) per allinearsi al repository Gitea. Aggiunge Gitea Actions sul modello di Chronos: CI su PR e main, rilascio da tag con gioco Windows (client Godot + server in server/), server Windows/Linux e immagine Docker nel registro Gitea, nightly. Aggiunge i riferimenti visivi 06–09, i modelli di PR e issue, l'ADR 0014 e aggiorna README (comandi locali), STATE e CLAUDE.md. 120 test verdi. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
51 lines
1.4 KiB
C#
51 lines
1.4 KiB
C#
using RailEnterprise.Tools.Commands;
|
|
|
|
namespace RailEnterprise.Tools;
|
|
|
|
/// <summary>Strumenti da riga di comando di Rail Enterprise.</summary>
|
|
public static class ToolsProgram
|
|
{
|
|
private static readonly IToolCommand[] Commands =
|
|
[
|
|
new ValidateDataCommand(),
|
|
new GenMapCommand(),
|
|
new SimulateCommand(),
|
|
new ProfileCommand(),
|
|
new BenchCommand(),
|
|
new SmokeCommand(),
|
|
new ReplayCommand(),
|
|
];
|
|
|
|
public static int Main(string[] args)
|
|
{
|
|
if (args.Length == 0 || args[0] is "-h" or "--help" or "help")
|
|
{
|
|
PrintHelp();
|
|
return args.Length == 0 ? 1 : 0;
|
|
}
|
|
var command = Commands.FirstOrDefault(c => c.Name == args[0]);
|
|
if (command is null)
|
|
{
|
|
Console.Error.WriteLine($"Comando sconosciuto: {args[0]}");
|
|
PrintHelp();
|
|
return 1;
|
|
}
|
|
try
|
|
{
|
|
return command.Run(new CommandLine(args[1..]));
|
|
}
|
|
catch (ArgumentException ex)
|
|
{
|
|
Console.Error.WriteLine($"{command.Name}: {ex.Message}");
|
|
Console.Error.WriteLine($"uso: railenterprise-tools {command.Usage}");
|
|
return 2;
|
|
}
|
|
}
|
|
|
|
private static void PrintHelp()
|
|
{
|
|
Console.WriteLine("railenterprise-tools <comando> [opzioni]");
|
|
foreach (var c in Commands) Console.WriteLine($" {c.Usage}");
|
|
}
|
|
}
|