question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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-secretsis:

-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:closed
  • Created 5 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
drewlsverncommented, May 4, 2018

Seems an uninstall and reinstall of the sdk fixed the issue. Thanks.

0reactions
peterhuenecommented, May 20, 2018

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Verbosity is used inconsistently in the CLI · Issue #9330
v is used inconsistently between CLI and bundled tools and is not consistent across CLI commands. This makes an inconstant user experience ...
Read more >
Bug #14725: Verbose mode does not work ...
In UNIX, commands usually do not print info messages (like "Host created"). Create a method like print_verbose and use it for all info...
Read more >
CLI verbosity levels - CLI Guidelines
When working with a CLI users from different backgrounds who operate different tasks might want to see information with different verbosity ...
Read more >
CLI Guidelines – A guide to help you write better command ...
We love the CLI, but so much of it is a mess and hard to use. This is our attempt to make the...
Read more >
Bug #1980515 “Snapcraft 7 inconsistent CLI options handling”
Setting the verbose flag will work when core22 is used but results in an error and non-zero exit code otherwise. $ snapcraft --version...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found