Status updates (feature/test update and batch-update) now verify the requested status against Roslyn audit classification. Mismatches require --override "reason" to force. Overrides are logged to a new status_overrides table and reviewable via 'override list' command.
47 lines
1.7 KiB
C#
47 lines
1.7 KiB
C#
using System.CommandLine;
|
|
using NatsNet.PortTracker.Commands;
|
|
using NatsNet.PortTracker.Data;
|
|
|
|
var dbOption = new Option<string>("--db")
|
|
{
|
|
Description = "Path to the SQLite database file",
|
|
DefaultValueFactory = _ => Path.Combine(Directory.GetCurrentDirectory(), "porting.db"),
|
|
Recursive = true
|
|
};
|
|
|
|
var schemaOption = new Option<string>("--schema")
|
|
{
|
|
Description = "Path to the SQL schema file",
|
|
DefaultValueFactory = _ => Path.Combine(Directory.GetCurrentDirectory(), "porting-schema.sql"),
|
|
Recursive = true
|
|
};
|
|
|
|
var rootCommand = new RootCommand("NATS .NET Porting Tracker");
|
|
rootCommand.Add(dbOption);
|
|
rootCommand.Add(schemaOption);
|
|
|
|
// init command
|
|
var initCommand = new Command("init", "Create or reset the database schema");
|
|
initCommand.SetAction(parseResult =>
|
|
{
|
|
var dbPath = parseResult.GetValue(dbOption)!;
|
|
var schemaPath = parseResult.GetValue(schemaOption)!;
|
|
using var db = new Database(dbPath);
|
|
Schema.Initialize(db, schemaPath);
|
|
Console.WriteLine($"Database initialized at {dbPath}");
|
|
});
|
|
|
|
rootCommand.Add(initCommand);
|
|
rootCommand.Add(ModuleCommands.Create(dbOption, schemaOption));
|
|
rootCommand.Add(FeatureCommands.Create(dbOption, schemaOption));
|
|
rootCommand.Add(TestCommands.Create(dbOption, schemaOption));
|
|
rootCommand.Add(LibraryCommands.Create(dbOption, schemaOption));
|
|
rootCommand.Add(DependencyCommands.Create(dbOption, schemaOption));
|
|
rootCommand.Add(ReportCommands.Create(dbOption, schemaOption));
|
|
rootCommand.Add(PhaseCommands.Create(dbOption, schemaOption));
|
|
rootCommand.Add(AuditCommand.Create(dbOption));
|
|
rootCommand.Add(OverrideCommands.Create(dbOption));
|
|
|
|
var parseResult = rootCommand.Parse(args);
|
|
return await parseResult.InvokeAsync();
|