puppetlabs/puppet — pull request #430 by mmrobins (2012-01-31 17:35:49+00:00)
Title: (#12329) Allow faces when_rendering blocks to take options

When rendering for face actions was implemented it was assumed that all
the options that an action took would go toward determining the data
that the when_invoked block returned, and the rendering would make
decisions based on that data's structure. However, there are times when
the data returned may be the same even with different options, and the
option will determine how it's rendered.

For example, the `module list` action has a --tree option that will
display the installed modules in a tree view based on dependencies. The
`module search` action will be able to highlight the word that was
searched for in the results.

This commit allows the when_rendering blocks to optionally add options
and arguments along with the invoked result. I made the options and
arguments optional since most when_rendering blocks won't need the
them, and having them show up in the block declaration when not used
is confusing. This also means that all faces previously written don't
need changes and this change is backward compatible.