Simplify access to the different forms of a formula's build options by
making options into real objects rather than strings, and expose both
the 'name' and 'flag' form.
When combining the set of old-style and new-style options, make sure
that the leading "--" is stripped.
Fixes displaying options in `brew options`, and the exotic case of
declaring options using the old syntax and then checking them with
`build.include?`
`brew options --installed` will now "do the right thing".
There is getting to be a small but noticeable amount of code duplication
among commands that take options like "--installed" or "--all"; it may
be worth factoring this out into a method that will return a collection
of formula objects based on the options that are passed.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
`brew options --installed` will print options for formulae that are
already installed.
ClosesHomebrew/homebrew#7565.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>