lib/kafo/kafo_configure.rb in kafo-0.8.1 vs lib/kafo/kafo_configure.rb in kafo-0.8.2
- old
+ new
@@ -299,10 +299,12 @@
params.sort.each do |param|
doc = param.doc.nil? ? 'UNDOCUMENTED' : param.doc.join("\n")
self.class.option parametrize(param), '', doc,
:default => param.value, :multivalued => param.multivalued?
+ self.class.option parametrize(param, 'reset-'), :flag,
+ "Reset #{param.name} to the default value"
end
end
# ARGV can contain values for attributes e.g. ['-l', 'info']
# so we accept either allowed args or those that does not start with '-' and are right after
@@ -343,12 +345,15 @@
def parse_cli_arguments
# enable/disable modules according to CLI
config.modules.each { |mod| send("enable_#{mod.name}?") ? mod.enable : mod.disable }
- # set values coming from CLI arguments
+ # set and reset values coming from CLI arguments
params.each do |param|
+ if send("reset_#{u(with_prefix(param))}?")
+ param.unset_value
+ end
variable_name = u(with_prefix(param))
variable_name += '_list' if param.multivalued?
cli_value = instance_variable_get("@#{variable_name}")
param.value = cli_value unless cli_value.nil?
end
@@ -378,9 +383,10 @@
'--debug',
'--trace',
'--color=false',
'--show_diff',
'--detailed-exitcodes',
+ '--reports=',
]
options.push '--noop' if noop?
options.push '--profile' if profile?
begin
command = PuppetCommand.new('include kafo_configure', options).command