293
294
295
296
297
298
299
300
301
302
303
|
# File 'lib/everyday-cli-utils/option.rb', line 293
def show_defaults
script_defaults = composite
global_defaults = composite(:global)
local_defaults = composite(:global, :local)
global_diff = EverydayCliUtils::MapUtil.hash_diff(global_defaults, script_defaults)
local_diff = EverydayCliUtils::MapUtil.hash_diff(local_defaults, global_defaults)
str = "Script Defaults:\n#{options_to_str(script_defaults)}\n"
str << "Script + Global Defaults:\n#{options_to_str(global_diff)}\n" unless global_diff.empty?
str << "Script + Global + Local Defaults:\n#{options_to_str(local_diff)}\n" unless local_diff.empty?
str
end
|