ls: print result count summary for databases and containers#129
Open
mkrueger wants to merge 1 commit into
Open
ls: print result count summary for databases and containers#129mkrueger wants to merge 1 commit into
mkrueger wants to merge 1 commit into
Conversation
Database and container listings previously printed nothing on an empty result, making an empty scope indistinguishable from a listing that returned nothing. ls now always prints a summary line (count or a 'No databases/containers found' message), matching the existing item-count behavior.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the ls command’s interactive output to always include a result-count summary when listing databases and containers, aligning those scopes with the existing “found N items” summary used when listing items. This improves UX by making “empty result” cases explicit instead of silently printing nothing.
Changes:
- Print a localized, plural-aware “found databases” summary after listing databases.
- Print a localized, plural-aware “found containers” summary after listing containers (including the database name).
- Document the summary-line behavior in the
lscommand docs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
docs/commands.md |
Documents that ls prints a summary line for databases/containers/items. |
CosmosDBShell/lang/en.ftl |
Adds plural-aware localized messages for database/container result counts. |
CosmosDBShell/Azure.Data.Cosmos.Shell.Commands/ListCommand.cs |
Emits the new summary lines after database/container listings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lsnow always prints a result-count summary when listing databases and containers, matching the existing behavior for listing items.Previously, the database and container listings printed nothing on an empty result. That made an empty scope indistinguishable from a listing that returned nothing (for example, when connected to an account whose databases are not enumerable via the SQL/Core API). Only the item listing printed a count (
found N items.).Changes
ListCommand.VisitConnectedStateAsyncnow printscommand-ls-found_databasesafter listing databases.ListCommand.ListDatabaseContainersAsyncnow printscommand-ls-found_containersafter listing containers.lang/en.ftl:command-ls-found_databases—No databases found./Found N database(s).command-ls-found_containers—No containers found in database X./Found N container(s) in database X.docs/commands.md.Notes
No databases/containers found.Validation
dotnet build CosmosDBShell/CosmosDBShell.csprojLocalizationKeyAuditTestsandListCommandTestspass (30/30).