NuGet/Home

Machine readable output for 'why' command

Open

#13,649 opened on Jul 24, 2024

View on GitHub
 (1 comment) (2 reactions) (1 assignee)HTML (1,459 stars) (292 forks)batch import
Functionality:WhyPriority:2Product:dotnet.exeType:Featurehelp wanted

Description

NuGet Product(s) Affected

dotnet.exe

Current Behavior

The output of the dotnet nuget why command is easily readable for humans but not for machines.

Desired Behavior

Have an optional switch that allows the output to be machine readable from the console output.

Ideas for the output format: json or plain with a delimiter. json

{
  "net472": { },
  "net6.0": [
    {
      "name": "Azure.Core",
      "version": "1.38.0",
      "packages": [
        {
          "name": "System.Text.Json",
          "version": "8.0.3"
        },
        {
          "name": "System.Memory.Data",
          "version": "1.0.2",
          "packages": [
            {
              "name": "System.Text.Json",
              "version": "8.0.3"
            }
          ]
        }
      ]
    }
  ]
}

plain

net472/
net6.0/System.Text.Json:8.0.3
net6.0/Azure.Core:1.38.0/System.Text.Json:8.0.3
net6.0/Azure.Core:1.38.0/System.Memory.Data:1.0.2/System.Text.Json:8.0.3

Additional Context

Following up on issue #13639.

We want to use the results of the dotnet nuget why command in automated reports for our developers. We therefore desire to use the data of the why command programmatically and make several processes easier.

Contributor guide