diff --git a/src/NuGetUtility/Program.cs b/src/NuGetUtility/Program.cs index f2c8c4d0..41a32bb3 100644 --- a/src/NuGetUtility/Program.cs +++ b/src/NuGetUtility/Program.cs @@ -99,6 +99,11 @@ public class Program Description = "This option allows to select a Target framework moniker (https://learn.microsoft.com/en-us/dotnet/standard/frameworks) for which to analyze dependencies.")] public string? TargetFramework { get; } = null; + [Option(LongName = "ignored-columns-from-output", + ShortName = "ignored-columns", + Description = "This option allows to specify column name(s) to exclude from the output")] + public string? IgnoredColumns { get; } = null; + private static string GetVersion() => typeof(Program).Assembly.GetCustomAttribute()?.InformationalVersion ?? string.Empty; @@ -288,5 +293,20 @@ private string[] GetInputFiles() throw new FileNotFoundException("Please provide an input file"); } + + private string[] GetIgnoredColumns() + { + if (IgnoredColumns == null) + { + return Array.Empty(); + } + + if (File.Exists(IgnoredColumns)) + { + return JsonSerializer.Deserialize(File.ReadAllText(IgnoredColumns))!; + } + + return new[] { IgnoredColumns }; + } } }