puppetlabs/puppet — pull request #455 by jeffweiss (2012-02-03 08:42:00+00:00)
Title: (#12404) Reduce redundant code in lib/puppet/application

Reduce redundant code by defining Puppet::Application.logdest_option,
which can then be called from applications that need a log destination
instead of copying the 9 lines of code specific to creating a log
destination.

Reduce redundant code by defining Puppet::Application.setup_logs
to ease (and standardize) the log setup across the applications.

Reduce redundant code by moving setup_host into Puppet::Application.

Encapsulate logic for exiting if Puppet.settings.print_config?

Encapsulate logic for sorting type providers in Puppet::Application::Describe.

Modify tests to use standard option :setdest.

Modify tests to mock options :setdest, :debug, and :verbose to
handle standardized checked against each option in consolidated
setup_logs method.