Open Marusyk opened 9 months ago
@Marusyk going the JSON route seems like the best option and an object model provides the most value in a Cake context.
ok, so should we allow only --format json
and have the alias like public ListPackage List(Project, Settings)
?
ok, so should we allow only
--format json
and have the alias likepublic ListPackage List(Project, Settings)
?
Yes, think that makes sense.
Can someone help me find the model for that json result? Didn't find anything here: https://github.com/dotnet/sdk/tree/main/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package
Depending on the parameters, the result is different every time. I would like to know all the possible attributes that can be returned and make a model for them.
Currently, I started with
Thin it's just a wrapper around NuGet.CommandLine.XPlat which probably means the code is somewhere around here
https://github.com/NuGet/NuGet.Client/tree/dev/src/NuGet.Core/NuGet.CommandLine.XPlat/ListPackage
Useful: https://github.com/NuGet/Home/blob/dev/accepted/2022/DotnetListPackageMachineReadableJsonOutput.md It's not quite written in a schema way, but it contains all the examples.
Thanks @Marusyk looking good so far. Some tests are failing. Ping when ready for next round
thanks @augustoproiete . can you help me? I can't figure out why the tests are failing
can anyone help me to fix this PR?)
Add an alias for
dotnet list package
commandFixes #4224
Here is the basic implementation. I need your suggestion on what we should do with the output. If the format is
console
we will receive smth like thisIf we allow only JSON, then I'll be able to create models and deserialize (for
console
format it is almost impossible) and return the result forpublic ListResult DotNetListPackage(...)
but what if someone just wants to get the output and that's all. What do you think?Thank you in advance