dotnet commands should not output usage information on all errors
#13251
Labels
Area:ErrorHandling
warnings and errors/log messages & related error codes.
Category:Quality Week
Issues that should be considered for quality week
Priority:2
Issues for the current backlog.
Product:dotnet.exe
Type:DCR
Design Change Request
NuGet Product(s) Affected
dotnet.exe
Current Behavior
However, a scenario that is more likely to confuse customers is:
Desired Behavior
Only show usage/help information when command line parsing fails, not on all failures.
For example, run
dotnet add package Some.Package.That.Does.Not.Exist. If done in a directory that does not contain any*.*projfile it outputs:Could not find any project in `D:\src\test\`.That's it, no usage information. Whereas, if I add
--arg-that-does-not-exist, then I get an error message saying the argument is not recognised, followed by the usage/help information.This is a pattern that most CLI apps use.
Additional Context
I believe that customers are getting confused by the extra verbosity in the error message, especially in the
dotnet add packagescenario where neither the first line nor the last line of the message output to customers is an error message. We have gotten github issues and VS feedback where the error message states what the problem is, but customers don't seem to notice and report the issue to us rather than fixing the issue themselves.The text was updated successfully, but these errors were encountered: