Skip to content

fix(output): prefix pagination next_actions with the binary name - #86

Merged
jpage-godaddy merged 2 commits into
mainfrom
binary-prefix-pagination
Aug 5, 2026
Merged

fix(output): prefix pagination next_actions with the binary name#86
jpage-godaddy merged 2 commits into
mainfrom
binary-prefix-pagination

Conversation

@jpage-godaddy

@jpage-godaddy jpage-godaddy commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • The suggested next-page command in next_actions (surfaced whenever a paginated command's response has more data) started at the noun/verb path — e.g. list --limit 2 --offset 2 — which isn't directly runnable as-is.
  • pagination_command_base now takes the CLI's configured binary name (CliConfig::name) and leads with it, so the suggestion is copy-pastable, e.g. my-cli list --limit 2 --offset 2.
  • (Refined during review) Copilot flagged that the binary name was pushed unquoted while every other token in the suggestion goes through quote_pagination_value. Since CliConfig::new doesn't validate name, a binary name with whitespace or shell metacharacters would have produced a suggestion that wasn't actually copy-pastable. Routed the binary name through the same quoting helper and added a regression test.
  • Updated the 10 pre-existing exact-match assertions in cli-engine/tests/pagination.rs and added next_page_action_quotes_a_binary_name_with_whitespace.

Test plan

  • cargo fmt --all --check
  • cargo clippy --all-targets -- -D warnings
  • RUSTDOCFLAGS='-D warnings' cargo doc --no-deps
  • cargo test --all-targets (all suites pass, including the full pagination.rs suite — 22 tests)
  • Copilot review: 1 comment raised and fixed, re-reviewed clean

🤖 Generated with Claude Code

The suggested next-page command in `next_actions` started at the
noun/verb path (e.g. `list --limit 2 --offset 2`), which isn't
directly runnable — a user has to know to prepend their own binary
name before pasting it. `pagination_command_base` now takes the CLI's
configured binary name and leads with it, so the suggestion is
copy-pastable as-is (e.g. `my-cli list --limit 2 --offset 2`).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves pagination UX in the cli_engine crate by making the “next page” suggestion (next_actions[].command) directly runnable: it now prefixes the reconstructed command fragment with the CLI binary name (CliConfig::name) instead of starting at the noun/verb path.

Changes:

  • Prefix paginated next_actions command suggestions with the configured binary name.
  • Update pagination documentation/comments to reflect the new copy-pastable behavior.
  • Update exact-match pagination integration tests to expect the binary name prefix.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
cli-engine/src/cli.rs Prefixes pagination next-action command reconstruction with CliConfig::name.
cli-engine/tests/pagination.rs Adjusts expected next_actions[].command strings (and human output assertions) to include the binary prefix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cli-engine/src/cli.rs
Copilot review: pagination_command_base prefixed the suggested
next-page command with CliConfig::name unquoted, while every other
token in the suggestion goes through quote_pagination_value. A binary
name containing whitespace or shell metacharacters (CliConfig::new
doesn't validate name) would produce a suggestion that isn't actually
copy-pastable, defeating the point of this fix. Route the binary name
through the same quoting helper and add a regression test.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@jpage-godaddy
jpage-godaddy merged commit f65ae91 into main Aug 5, 2026
4 checks passed
@jpage-godaddy
jpage-godaddy deleted the binary-prefix-pagination branch August 5, 2026 15:39
@github-actions github-actions Bot mentioned this pull request Aug 5, 2026
jpage-godaddy pushed a commit that referenced this pull request Aug 5, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>cli-engine: 0.8.1</summary>

##
[0.8.1](cli-engine-v0.8.0...cli-engine-v0.8.1)
(2026-08-05)


### Bug Fixes

* **auth:** retry ExecProvider spawn on transient ETXTBSY
([#84](#84))
([b2be4f3](b2be4f3))
* **output:** prefix pagination next_actions with the binary name
([#86](#86))
([f65ae91](f65ae91))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants