opscode/mixlib-cli — pull request #11 by danielsdeleo (2013-01-09 23:59:20+00:00)
Title: [CHEF-3497] Optionally Separate Default Values from User-Supplied Values

This contributes to the fix for an issue with knife plugins when a `:default` value is specified via the mixlib-cli DSL.

The desired order of application for settings is:
1. defaults
2. config file
3. CLI options

Currently, mixlib-cli merges CLI options on top of defaults. This is problematic because programs such as knife need to parse the command line options in order to select the correct config file to use.

With this patch, defaults can be kept separate, so that the command line options can be parsed (in order to select the correct config file) and then settings can be merged in the desired order.

Also note that the new behavior must be opt-in, or else existing programs using mixlib-cli (without a pessimistic dependency--this includes chef) would break.