Repository navigation
fix(cli): keep filters in the next page command - #508
Open
pcbeingused333 wants to merge 1 commit into
Open
pcbeingused333 wants to merge 1 commit into
pcbeingused333 wants to merge 1 commit into
Conversation
The command printed under "To get the next page" was a fixed string, so it dropped the flags and arguments of the command that produced the page. For attempt list that left out the required --event-id.
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.
The command printed under "To get the next page:" is a fixed string per resource, so it drops everything the user passed. For example:
Running the suggestion fails with
--event-id is required. On other list commands it runs but silently returns an unfiltered (or differently sorted) next page, andtransformation executions listloses its transformation argument.printPaginationInfonow rebuilds the line from the command that was run: command path, positional arguments and the flags that were set, with--prev/--nextreplaced by the new cursor. Values that need it are single-quoted for a POSIX shell. Of the global flags only--profileand--hookdeck-configare repeated, since they select the account; the rest are left out so that--api-key/--cli-keyare never echoed.source,destinationandconnection listdo not accept--nextonmainyet; that is handled separately in #501.Tests:
pkg/cmd/pagination_output_test.goruns the list commands against a stub server and checks the suggested line; all six cases fail without the change.go vet ./pkg/cmd/andgo test ./pkg/cmd/pass.This change was prepared with AI assistance.