Open dominoFire opened 1 year ago
Two commands isn't unheard of - docker
for example has both noun-first and verb-first versions, and often aliases them both to the same underlying command handler. In the .NET CLI for recent versions, we try to prefer noun-first where possible, but the nuget
command already doesn't align with this (nor does the add
command on the CLI itself, which is a bit older). So there's not a 100 % consistent guideline that's applicable here.
I would say that consistency within the dotnet nuget
command is the first priority, but it should be very easy to support both forms in System.CommandLine if you wanted to reach a bit. The noun-first
command could even emitt a message with the correct format. The dotnet new
command did this for .NET 7 for deprecated forms of their own list, search, etc commands:
15:28:15 ❯ dotnet new --list blah
Warning: use of 'dotnet new --list' is deprecated. Use 'dotnet new list' instead.
For more information, run:
dotnet new list -h
No templates found matching: 'blah'.
To search for the templates on NuGet.org, run:
dotnet new search blah
For details on the exit code, refer to https://aka.ms/templating-exit-codes#103
Per spec, dotnet add source
was preferred to be consistent with .NET CLI in version 1.x
https://github.com/NuGet/Home/wiki/Add-nuget-sources-command-to-the-dotnet-CLI
Then, I will try to align to .NET 7 noun-first approach:
dotnet nuget sources add
: Run commanddotnet nuget add source
: Show warning message, run command
While working on System.CommandLine migration, I discovered that we have two commands that refer to the same action:
dotnet nuget sources add
dotnet nuget add source
Question: which command should we preserve in dotnet.exe NuGet commands?
dotnet nuget sources add
dotnet nuget add source
Running
dotnet nuget sources add
gives:Running
dotnet nuget add source
cc @baronfel