Verbosity is used inconsistently in the CLI
See original GitHub issue-v is used inconsistently between CLI and bundled tools and is not consistent across CLI commands.
This makes an inconstant user experience and confusing help. Since we anticipate global tool authors following these patterns, it sets us up for an unnecessary fractured ecosystem.
Current use
CLI
The CLI usage is:
-v|--verbosity Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].
The CLI produces an error if a verbosity level not given: this is especially ugly because we print help and obscure the error.
At least dotnet new
and dotnet buidserver
do not support --vervbosity.
Bundled tools: watch, sql-cache, user-secrets
The usage in dotnet watch
, dotnet ef
, dotnet dev-certs
, dotnet sql-cache
, dotnet user-secrets
is:
-v|–verbose Show verbose output.
Proposal:
Bundled tools and CLI support --verbosity consistently with no argument being “[d]etailed”, and that this be the guidance for command line creation for Global Tools. As a result, these will all be equivalent
–verbosity –verbosity d -v -v d –verbose (bundled tools only, and possibly marked obsolete)
This requires the CLI support a default value for the --verbosity switch of “d”
This requires bundled tool to support --verbosity with a -v in addition to --verbose.
Special handling
To avoid backward compatibility issues with dotnet run
and dotnet install
, it’s important that the parser be greedy. For example, in this case, “detailed” should not be passed on to the application being run:
dotnet run -v detailed
dotnet install -v detailed
Assuming errors no longer occurring are not considered breaking changes, then this is not a breaking change. The following would have previously resulted in an error, and would now pass “banana” on to the application:
dotnet run -v banana
Passing no verbosity level also results in an error today:
dotnet run -v
Breaking changes
From the perspective of bundled tools, especially dotnet watch
a breaking change may occur if the verbosity level passed is also an executable that would be run. The following code would attempt to run an application named “detailed” today and would set the detailed switch under this proposal.
dotnet watch -v detailed
Please weigh in if you see any more breaking change scenarios.
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (6 by maintainers)
Top GitHub Comments
Seems an uninstall and reinstall of the sdk fixed the issue. Thanks.
@KathleenDollard I’m closing this as part of the help text work in
release/2.1.4xx
.--verbosity
has been removed from the top-level and the few commands that do support it now make it clear the option is controlling the MSBuild verbosity.