audit notes work completed, test fixes work (95% done), new sprints, new data sources setup and configuration
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.CommandLine;
|
||||
using System.CommandLine.Invocation;
|
||||
using System.CommandLine.Parsing;
|
||||
using System.Collections.Immutable;
|
||||
using System.Text;
|
||||
@@ -11,7 +12,7 @@ namespace StellaOps.Tools.GoldenPairs;
|
||||
|
||||
public static class GoldenPairsApp
|
||||
{
|
||||
public static Task<int> RunAsync(string[] args)
|
||||
public static int RunAsync(string[] args)
|
||||
{
|
||||
var repoRootOption = new Option<DirectoryInfo?>("--repo-root")
|
||||
{
|
||||
@@ -24,21 +25,22 @@ public static class GoldenPairsApp
|
||||
};
|
||||
|
||||
var root = new RootCommand("Golden pairs corpus tooling.");
|
||||
root.AddGlobalOption(repoRootOption);
|
||||
root.AddGlobalOption(datasetRootOption);
|
||||
root.Add(repoRootOption);
|
||||
root.Add(datasetRootOption);
|
||||
|
||||
root.AddCommand(BuildMirrorCommand(repoRootOption, datasetRootOption));
|
||||
root.AddCommand(BuildDiffCommand(repoRootOption, datasetRootOption));
|
||||
root.AddCommand(BuildValidateCommand(repoRootOption, datasetRootOption));
|
||||
root.Add(BuildMirrorCommand(repoRootOption, datasetRootOption));
|
||||
root.Add(BuildDiffCommand(repoRootOption, datasetRootOption));
|
||||
root.Add(BuildValidateCommand(repoRootOption, datasetRootOption));
|
||||
|
||||
return root.InvokeAsync(args);
|
||||
var parseResult = root.Parse(args);
|
||||
return parseResult.Invoke();
|
||||
}
|
||||
|
||||
private static Command BuildMirrorCommand(Option<DirectoryInfo?> repoRootOption, Option<DirectoryInfo?> datasetRootOption)
|
||||
{
|
||||
var cveArgument = new Argument<string>("cve", "CVE identifier to mirror.");
|
||||
var cveArgument = new Argument<string>("cve") { Description = "CVE identifier to mirror." };
|
||||
var command = new Command("mirror", "Fetch artifacts for a golden pair.");
|
||||
command.AddArgument(cveArgument);
|
||||
command.Add(cveArgument);
|
||||
|
||||
command.SetAction(async (parseResult, cancellationToken) =>
|
||||
{
|
||||
@@ -95,16 +97,16 @@ public static class GoldenPairsApp
|
||||
|
||||
private static Command BuildDiffCommand(Option<DirectoryInfo?> repoRootOption, Option<DirectoryInfo?> datasetRootOption)
|
||||
{
|
||||
var cveArgument = new Argument<string>("cve", "CVE identifier to diff.");
|
||||
var cveArgument = new Argument<string>("cve") { Description = "CVE identifier to diff." };
|
||||
var command = new Command("diff", "Run diff analysis on a golden pair.");
|
||||
command.AddArgument(cveArgument);
|
||||
command.Add(cveArgument);
|
||||
|
||||
var outputOption = new Option<string>("--output")
|
||||
{
|
||||
Description = "Output format: json or table.",
|
||||
DefaultValueFactory = _ => "json"
|
||||
};
|
||||
command.AddOption(outputOption);
|
||||
command.Add(outputOption);
|
||||
|
||||
command.SetAction(async (parseResult, cancellationToken) =>
|
||||
{
|
||||
@@ -166,7 +168,7 @@ public static class GoldenPairsApp
|
||||
{
|
||||
Description = "Stop at first failure."
|
||||
};
|
||||
command.AddOption(failFastOption);
|
||||
command.Add(failFastOption);
|
||||
|
||||
command.SetAction(async (parseResult, cancellationToken) =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user