mxcl/homebrew — pull request #24371 by jacknagel (2013-11-16 06:51:43+00:00)
Title: Improve `brew leaves` and move it into core

The current criteria for exclusion from `brew leaves` is just "is this formula a dep of any installed formula", but we can do better by respecting the installed option set.

For example, currently if ghostscript and imagemagick are installed, then ghostscript cannot be a leaf because imagemagick has an optional dependency on ghostscript. But if we inspect imagemagick's install receipt, we can avoid this false negative.