summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util/settings/boolean_setting.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/util/settings/boolean_setting.rb')
-rw-r--r--lib/puppet/util/settings/boolean_setting.rb40
1 files changed, 20 insertions, 20 deletions
diff --git a/lib/puppet/util/settings/boolean_setting.rb b/lib/puppet/util/settings/boolean_setting.rb
index 67fce9ae3..e4678c9b4 100644
--- a/lib/puppet/util/settings/boolean_setting.rb
+++ b/lib/puppet/util/settings/boolean_setting.rb
@@ -2,29 +2,29 @@ require 'puppet/util/settings/setting'
# A simple boolean.
class Puppet::Util::Settings::BooleanSetting < Puppet::Util::Settings::Setting
- # get the arguments in getopt format
- def getopt_args
- if short
- [["--#{name}", "-#{short}", GetoptLong::NO_ARGUMENT], ["--no-#{name}", GetoptLong::NO_ARGUMENT]]
- else
- [["--#{name}", GetoptLong::NO_ARGUMENT], ["--no-#{name}", GetoptLong::NO_ARGUMENT]]
- end
+ # get the arguments in getopt format
+ def getopt_args
+ if short
+ [["--#{name}", "-#{short}", GetoptLong::NO_ARGUMENT], ["--no-#{name}", GetoptLong::NO_ARGUMENT]]
+ else
+ [["--#{name}", GetoptLong::NO_ARGUMENT], ["--no-#{name}", GetoptLong::NO_ARGUMENT]]
end
+ end
- def optparse_args
- if short
- ["--[no-]#{name}", "-#{short}", desc, :NONE ]
- else
- ["--[no-]#{name}", desc, :NONE]
- end
+ def optparse_args
+ if short
+ ["--[no-]#{name}", "-#{short}", desc, :NONE ]
+ else
+ ["--[no-]#{name}", desc, :NONE]
end
+ end
- def munge(value)
- case value
- when true, "true"; return true
- when false, "false"; return false
- else
- raise ArgumentError, "Invalid value '#{value.inspect}' for #{@name}"
- end
+ def munge(value)
+ case value
+ when true, "true"; return true
+ when false, "false"; return false
+ else
+ raise ArgumentError, "Invalid value '#{value.inspect}' for #{@name}"
end
+ end
end