Repository navigation
Conversation
Member
|
Please disclose any use of AI/LLMs. |
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.
Fixes #1536.
The
--sortflag was registered on every list command, including those whoseSortOptionis nil (iso, network, server-type, load-balancer-type, storage-box-type). It now is only registered when sorting is supported, so it disappears from--helpand the generated docs for those commands.Because the flag no longer exists on those commands, the "resource does not support sorting. Ignoring --sort flag" warning in
Runbecame unreachable and is removed; passing--sortthere is now an unknown-flag error.Changes:
internal/cmd/base/list.go: register--sortonly ifSortOption != nil; simplify sort handling inRun.internal/cmd/base/list_test.go: test that the flag exists with aSortOptionand not without (fails when the fix is reverted).docs/reference/manual/*: regenerated withgo generate ./...; only the 5 unsupported list commands changed, all other list commands keep--sort.Checks run locally:
go test ./...(all pass),golangci-lint runv2.15.0 on the changed package (0 issues),go generate ./...(docs up to date).