diff options
| author | Ian Taylor <ian@lorf.org> | 2009-06-05 12:38:35 -0400 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2009-06-06 09:11:28 +1000 |
| commit | 41ce18cc8ea239d1633fc6cd9e9f599957a82e74 (patch) | |
| tree | 9d398b4e3e6d726a174b5b57094c7dd6749ccf0e /ext | |
| parent | f3b40923605420f774dac298fb1708de180c0a81 (diff) | |
| download | puppet-41ce18cc8ea239d1633fc6cd9e9f599957a82e74.tar.gz puppet-41ce18cc8ea239d1633fc6cd9e9f599957a82e74.tar.xz puppet-41ce18cc8ea239d1633fc6cd9e9f599957a82e74.zip | |
Changed tabs to spaces without interfering with indentation or alignment
Diffstat (limited to 'ext')
| -rwxr-xr-x | ext/bin/sleeper | 24 | ||||
| -rwxr-xr-x | ext/module_puppet | 12 | ||||
| -rwxr-xr-x | ext/nagios/naggen | 16 | ||||
| -rwxr-xr-x | ext/puppet-test | 30 | ||||
| -rw-r--r-- | ext/puppetstoredconfigclean.rb | 36 |
5 files changed, 59 insertions, 59 deletions
diff --git a/ext/bin/sleeper b/ext/bin/sleeper index 980d66ac1..9837db2ec 100755 --- a/ext/bin/sleeper +++ b/ext/bin/sleeper @@ -38,20 +38,20 @@ end debug = false result = GetoptLong.new( - [ "--debug", "-d", GetoptLong::NO_ARGUMENT ], - [ "--help", "-h", GetoptLong::NO_ARGUMENT ] + [ "--debug", "-d", GetoptLong::NO_ARGUMENT ], + [ "--help", "-h", GetoptLong::NO_ARGUMENT ] ) result.each { |opt,arg| - case opt - when "--help" - puts "There is no help yet" - exit - when "--debug" - debug = true - else - raise "Invalid option '#{opt}'" - end + case opt + when "--help" + puts "There is no help yet" + exit + when "--debug" + debug = true + else + raise "Invalid option '#{opt}'" + end } trap(:INT) { @@ -59,7 +59,7 @@ trap(:INT) { } unless debug - daemonize() + daemonize() end # Sleep for no more than two minutes diff --git a/ext/module_puppet b/ext/module_puppet index 4ee273451..5834627e2 100755 --- a/ext/module_puppet +++ b/ext/module_puppet @@ -52,12 +52,12 @@ require 'puppet/network/client' require 'getoptlong' options = [ - [ "--debug", "-d", GetoptLong::NO_ARGUMENT ], - [ "--help", "-h", GetoptLong::NO_ARGUMENT ], - [ "--logdest", "-l", GetoptLong::REQUIRED_ARGUMENT ], - [ "--verbose", "-v", GetoptLong::NO_ARGUMENT ], - [ "--use-nodes", GetoptLong::NO_ARGUMENT ], - [ "--version", "-V", GetoptLong::NO_ARGUMENT ] + [ "--debug", "-d", GetoptLong::NO_ARGUMENT ], + [ "--help", "-h", GetoptLong::NO_ARGUMENT ], + [ "--logdest", "-l", GetoptLong::REQUIRED_ARGUMENT ], + [ "--verbose", "-v", GetoptLong::NO_ARGUMENT ], + [ "--use-nodes", GetoptLong::NO_ARGUMENT ], + [ "--version", "-V", GetoptLong::NO_ARGUMENT ] ] # Add all of the config parameters as valid options. diff --git a/ext/nagios/naggen b/ext/nagios/naggen index ffbd32ba2..6ff09e260 100755 --- a/ext/nagios/naggen +++ b/ext/nagios/naggen @@ -225,10 +225,10 @@ class NagiosWriter end arguments = [ - [ "--compare", "-c", GetoptLong::NO_ARGUMENT ], - [ "--debug", "-d", GetoptLong::NO_ARGUMENT ], - [ "--verbose", "-v", GetoptLong::NO_ARGUMENT ], - [ "--help", "-h", GetoptLong::NO_ARGUMENT ] + [ "--compare", "-c", GetoptLong::NO_ARGUMENT ], + [ "--debug", "-d", GetoptLong::NO_ARGUMENT ], + [ "--verbose", "-v", GetoptLong::NO_ARGUMENT ], + [ "--help", "-h", GetoptLong::NO_ARGUMENT ] ] Puppet.settings.addargs(arguments) @@ -237,8 +237,8 @@ result = GetoptLong.new(*arguments) $options = {} result.each { |opt,arg| - case opt - when "--help" + case opt + when "--help" begin require 'rdoc/usage' RDoc::usage && exit @@ -264,9 +264,9 @@ result.each { |opt,arg| $options[:debug] = true when "--debug" $options[:debug] = true - else + else Puppet.settings.handlearg(opt, arg) - end + end } # Read in Puppet settings, so we know how Puppet's configured. diff --git a/ext/puppet-test b/ext/puppet-test index 3901cc801..bf6c2de39 100755 --- a/ext/puppet-test +++ b/ext/puppet-test @@ -408,21 +408,21 @@ end $cmdargs = [ - [ "--compile", "-c", GetoptLong::NO_ARGUMENT ], - [ "--describe", GetoptLong::REQUIRED_ARGUMENT ], - [ "--retrieve", "-R", GetoptLong::REQUIRED_ARGUMENT ], - [ "--fork", GetoptLong::REQUIRED_ARGUMENT ], - [ "--fqdn", "-F", GetoptLong::REQUIRED_ARGUMENT ], - [ "--suite", "-s", GetoptLong::REQUIRED_ARGUMENT ], - [ "--test", "-t", GetoptLong::REQUIRED_ARGUMENT ], - [ "--pause", "-p", GetoptLong::NO_ARGUMENT ], - [ "--repeat", "-r", GetoptLong::REQUIRED_ARGUMENT ], - [ "--node", "-n", GetoptLong::REQUIRED_ARGUMENT ], - [ "--debug", "-d", GetoptLong::NO_ARGUMENT ], - [ "--help", "-h", GetoptLong::NO_ARGUMENT ], - [ "--list", "-l", GetoptLong::NO_ARGUMENT ], - [ "--verbose", "-v", GetoptLong::NO_ARGUMENT ], - [ "--version", "-V", GetoptLong::NO_ARGUMENT ], + [ "--compile", "-c", GetoptLong::NO_ARGUMENT ], + [ "--describe", GetoptLong::REQUIRED_ARGUMENT ], + [ "--retrieve", "-R", GetoptLong::REQUIRED_ARGUMENT ], + [ "--fork", GetoptLong::REQUIRED_ARGUMENT ], + [ "--fqdn", "-F", GetoptLong::REQUIRED_ARGUMENT ], + [ "--suite", "-s", GetoptLong::REQUIRED_ARGUMENT ], + [ "--test", "-t", GetoptLong::REQUIRED_ARGUMENT ], + [ "--pause", "-p", GetoptLong::NO_ARGUMENT ], + [ "--repeat", "-r", GetoptLong::REQUIRED_ARGUMENT ], + [ "--node", "-n", GetoptLong::REQUIRED_ARGUMENT ], + [ "--debug", "-d", GetoptLong::NO_ARGUMENT ], + [ "--help", "-h", GetoptLong::NO_ARGUMENT ], + [ "--list", "-l", GetoptLong::NO_ARGUMENT ], + [ "--verbose", "-v", GetoptLong::NO_ARGUMENT ], + [ "--version", "-V", GetoptLong::NO_ARGUMENT ], ] # Add all of the config parameters as valid $options. diff --git a/ext/puppetstoredconfigclean.rb b/ext/puppetstoredconfigclean.rb index a96ec4faf..1b8354dae 100644 --- a/ext/puppetstoredconfigclean.rb +++ b/ext/puppetstoredconfigclean.rb @@ -11,36 +11,36 @@ require 'getoptlong' config = '/etc/puppet/puppet.conf' def printusage(error_code) - puts "Usage: #{$0} [ list of hostnames as stored in hosts table ]" - puts "\n Options:" - puts "--config <puppet config file>" - exit(error_code) + puts "Usage: #{$0} [ list of hostnames as stored in hosts table ]" + puts "\n Options:" + puts "--config <puppet config file>" + exit(error_code) end opts = GetoptLong.new( - [ "--config", "-c", GetoptLong::REQUIRED_ARGUMENT ], + [ "--config", "-c", GetoptLong::REQUIRED_ARGUMENT ], [ "--help", "-h", GetoptLong::NO_ARGUMENT ], [ "--usage", "-u", GetoptLong::NO_ARGUMENT ], [ "--version", "-v", GetoptLong::NO_ARGUMENT ] ) begin - opts.each do |opt, arg| - case opt - when "--config" - config = arg + opts.each do |opt, arg| + case opt + when "--config" + config = arg - when "--help" - printusage(0) + when "--help" + printusage(0) - when "--usage" - printusage(0) + when "--usage" + printusage(0) - when "--version" - puts "%s" % Puppet.version - exit - end - end + when "--version" + puts "%s" % Puppet.version + exit + end + end rescue GetoptLong::InvalidOption => detail $stderr.puts "Try '#{$0} --help'" exit(1) |
