-
Notifications
You must be signed in to change notification settings - Fork 689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for dotnet list package command #1320
Conversation
Discussed a bit with @emgarten anfd @alpaix: Better UI possibility -
|
var frameworks = listPkg.Option( | ||
"-f|--framework", | ||
Strings.ListPkg_FrameworksDescription, | ||
CommandOptionType.SingleValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like down below this is splitting the value. I would instead expect this to take MultipleValue so it is handled for you. Possibly the other inputs should allow multiple also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is consistent with other dotnet package commands.
|
||
private static void ValidateProjectPath(CommandOption projectPath, string commandName) | ||
{ | ||
if (!File.Exists(projectPath.Value()) || !projectPath.Value().EndsWith("proj", StringComparison.OrdinalIgnoreCase)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this return if the option was not given? will this be a null ref?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
projectPath
cannot be null, otherwise the command will throw help.
@anangaur can you take a look at the UI here? |
I am right now using the dotnet platform to build a bunch of microservices. This feature would be perfect in a CI software to list all the dependencies of a project and send the data to a central database for visualisation. Which in turn will make it easier to understand which nuget packages is consumed in which projects. It would be very nice if you would consider the possiblity of a more machine friendly format such as json or xml as the output. |
@kri5t the list command displays all packages from a feed. To get the dependencies of a project take a look at |
2dbae6e
to
02a562a
Compare
dbe35e2
to
546f810
Compare
This PR adds support for dotnet list package command in NuGet. Fixes part of NuGet/Home#4102
Spec
Description
The command is used to list the package references for a project. The command allows filtering on package id and framework.
-help
Usage
csproj file -
Example 1
Unconditional to print all references.
Example 2
References for a framework.
Example 3
References for a package.
Example 4
Random inputs.