From 23692f77f0b416d6aa2c860613e30aa91b13e696 Mon Sep 17 00:00:00 2001 From: thomhurst <9139608+thomhurst@users.noreply.github.com> Date: Sun, 12 Apr 2026 03:34:45 +0000 Subject: [PATCH] chore: Update grype CLI options --- .../AssemblyInfo.Generated.cs | 2 +- .../Options/GrypeDbDiffOptions.Generated.cs | 69 +++++++++++++++++++ .../Services/GrypeDb.Generated.cs | 15 ++++ 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 src/ModularPipelines.Grype/Options/GrypeDbDiffOptions.Generated.cs diff --git a/src/ModularPipelines.Grype/AssemblyInfo.Generated.cs b/src/ModularPipelines.Grype/AssemblyInfo.Generated.cs index 8a30a3a720..3c61368b0c 100644 --- a/src/ModularPipelines.Grype/AssemblyInfo.Generated.cs +++ b/src/ModularPipelines.Grype/AssemblyInfo.Generated.cs @@ -6,4 +6,4 @@ using System.Reflection; [assembly: AssemblyMetadata("ModularPipelines.OptionsGenerator.Tool", "grype")] -[assembly: AssemblyMetadata("ModularPipelines.OptionsGenerator.GeneratedAt", "2026-03-29T03:15:57.4390081Z")] +[assembly: AssemblyMetadata("ModularPipelines.OptionsGenerator.GeneratedAt", "2026-04-12T03:33:54.2492196Z")] diff --git a/src/ModularPipelines.Grype/Options/GrypeDbDiffOptions.Generated.cs b/src/ModularPipelines.Grype/Options/GrypeDbDiffOptions.Generated.cs new file mode 100644 index 0000000000..c6b6bf92ef --- /dev/null +++ b/src/ModularPipelines.Grype/Options/GrypeDbDiffOptions.Generated.cs @@ -0,0 +1,69 @@ +// +// This file was generated by ModularPipelines.OptionsGenerator. +// Do not edit this file manually. +// + +using System.CodeDom.Compiler; +using System.Diagnostics.CodeAnalysis; +using ModularPipelines.Attributes; +using ModularPipelines.Grype.Options; + +namespace ModularPipelines.Grype.Options; + +/// +/// Diff two databases, showing packages with added, removed, and modified vulnerability matches +/// +[GeneratedCode("ModularPipelines.OptionsGenerator", "")] +[ExcludeFromCodeCoverage] +[CliSubCommand("db", "diff")] +public record GrypeDbDiffOptions : GrypeOptions +{ + /// + /// help for diff + /// + [CliFlag("--help", ShortForm = "-h")] + public bool? Help { get; set; } + + /// + /// format to display results (available=[text, json]) (default "text") + /// + [CliOption("--output", ShortForm = "-o", Format = OptionFormat.EqualsSeparated)] + public string? Output { get; set; } + + /// + /// only include packages + /// + [CliFlag("--packages")] + public bool? Packages { get; set; } + + /// + /// only include vulnerabilities + /// + [CliFlag("--vulns")] + public bool? Vulns { get; set; } + + /// + /// grype configuration file(s) to use + /// + [CliOption("--config", ShortForm = "-c", Format = OptionFormat.EqualsSeparated, AllowMultiple = true)] + public IEnumerable? Config { get; set; } + + /// + /// configuration profiles to use + /// + [CliOption("--profile", Format = OptionFormat.EqualsSeparated, AllowMultiple = true)] + public IEnumerable? Profile { get; set; } + + /// + /// suppress all logging output + /// + [CliFlag("--quiet", ShortForm = "-q")] + public bool? Quiet { get; set; } + + /// + /// increase verbosity (-v = info, -vv = debug) + /// + [CliOption("--verbose", ShortForm = "-v", Format = OptionFormat.EqualsSeparated)] + public int? Verbose { get; set; } + +} diff --git a/src/ModularPipelines.Grype/Services/GrypeDb.Generated.cs b/src/ModularPipelines.Grype/Services/GrypeDb.Generated.cs index b10cdc1361..59128a80a6 100644 --- a/src/ModularPipelines.Grype/Services/GrypeDb.Generated.cs +++ b/src/ModularPipelines.Grype/Services/GrypeDb.Generated.cs @@ -84,6 +84,21 @@ public virtual async Task Delete( return await _command.ExecuteCommandLineTool(options ?? new GrypeDbDeleteOptions(), executionOptions, cancellationToken); } + /// + /// Diff two databases, showing packages with added, removed, and modified vulnerability matches + /// + /// The command options. + /// The execution configuration options. + /// Cancellation token. + /// The command result. + public virtual async Task Diff( + GrypeDbDiffOptions options = default, + CommandExecutionOptions executionOptions = null, + CancellationToken cancellationToken = default) + { + return await _command.ExecuteCommandLineTool(options ?? new GrypeDbDiffOptions(), executionOptions, cancellationToken); + } + /// /// import a vulnerability database archive from a local FILE or URL. ///