Skip to content

feat: show only what you installed, hide dependencies by default - #4

Merged
batuhan-bas merged 1 commit into
mainfrom
feat/requested-vs-deps
Oct 8, 2026
Merged

batuhan-bas merged 1 commit into
mainfrom
feat/requested-vs-deps

Conversation

@batuhan-bas

Copy link
Copy Markdown
Owner

Stacked on #3. Merge after it.

Why

brew list mixes what you installed with everything pulled in as a dependency. On a real machine:

Formulas
Installed by the user (installed_on_request) 23
Missing from brew info (untrusted tap / removed) 3
Installed as a dependency 127

Changes

  • Default: only what you installed, plus casks. The shelf goes from 163 rows to 36 on that machine. Footer: 127 dependencies hidden — run 'brewshelf --all' to show them.
  • --all / -a: everything. Dependencies are dimmed, with a footer explaining it.
  • Formulas missing from brew info can't be classified and are shown: better one dependency too many than hiding something you installed.
  • installed_on_request is more accurate than brew leaves: e.g. mpg123 was installed by the user but is also a dependency, so leaves misses it.
  • Unknown options exit with code 2 and a message.
  • Parsing fix: JSON rows now use \x1f as separator instead of a tab. Tabs are whitespace for read, so an empty description shifted the next field. There is a test that fails with tabs: a dependency without description.
  • "Other / Dependencies" → "Other".

Tests (45 checks, was 28)

Hidden dependencies and count, dependency without description, unclassifiable formulas, --all, -a, unknown option, and dependency hiding with both JSON parsers.

On a real machine 127 of 153 formulas were installed as dependencies
(codecs, libraries, ...), burying the 26 the user chose.

- hide formulas installed only as a dependency (Homebrew's
  installed_on_request flag) and count them at the bottom
- --all / -a shows everything, dependencies dimmed
- formulas missing from brew info (untrusted taps) are shown: better a
  dependency too many than a hidden package you installed
- unknown options exit 2 with a message
- use a non-whitespace field separator (\x1f): with tabs, an empty
  description shifted the following fields
- rename "Other / Dependencies" to "Other"
- tests: dependencies, --all, -a, unknown option, per-parser checks
  (45 checks)
Base automatically changed from feat/brew-descriptions to main October 8, 2026 08:18
@batuhan-bas
batuhan-bas merged commit c1edc52 into main Oct 8, 2026
1 check passed
@batuhan-bas
batuhan-bas deleted the feat/requested-vs-deps branch October 8, 2026 08:18
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.

1 participant