Skip to content

search: Suppress headers in quiet mode - #24366

Merged
MikeMcQuaid merged 1 commit into
Homebrew:mainfrom
abitrolly:quiet-search
Oct 27, 2026
Merged

MikeMcQuaid merged 1 commit into
Homebrew:mainfrom
abitrolly:quiet-search

Conversation

@abitrolly

@abitrolly abitrolly commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

If search output is piped to another command, the headers are suppressed and each package name is printed on a separate line.

As a user, I had no idea that the headers were suppressed until I looked through the code, so I enabled --quiet flag to force the same behavior.


  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

If search output is piped to another command, the headers are
suppressed and each package name is printed on a separate line.

As a user, I had no idea that the headers were suppressed until
I looked through the code, so I enabled --quiet flag to force
the same behavior.
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 772688a8-590e-48ee-8fb7-a1cba5e41010
Commits

Reviewing files that changed from the base of the PR and between c6069d2 and 67c2e68.

Files selected for processing: 1
  • Library/Homebrew/cmd/search.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Search results now use formatted terminal output only when displayed in an interactive terminal with quiet mode off. In quiet mode or when output is redirected, results are printed directly, making them better suited to scripts and other non-interactive use.

The search command now passes its quiet option to result printing. Formula and cask results use formatted terminal output only when standard output is a TTY and quiet mode is off.

Changes: Search output

Layer / File(s) Summary
Pass quiet mode to result printing
Library/Homebrew/cmd/search.rb
run passes the quiet option to print_results. Formulae and casks use formatted output only when standard output is a TTY and quiet mode is off; otherwise, the results print directly.

Priority: Low

Merge Risk: Minimal · up to 67c2e

The requested quiet search output behavior is implemented without an identified merge-blocking risk.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly describes the main change: suppressing search result headers when quiet mode is enabled.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description states that piped search output suppresses headers and prints each package name on a separate line, and that the author added a --quiet flag to force that behaviour. This matches the c…
Full details: Description check

Explanation

The description states that piped search output suppresses headers and prints each package name on a separate line, and that the author added a --quiet flag to force that behaviour. This matches the changeset, which passes the quiet flag into print_results and suppresses formatted output when quiet mode is on. The description is related to the change, so the check passes.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good idea, thanks!

@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Oct 27, 2026
Merged via the queue into Homebrew:main with commit b800819 Oct 27, 2026
58 of 61 checks passed
@abitrolly
abitrolly deleted the quiet-search branch October 27, 2026 17:41
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.

2 participants

⌂ 换网址