@@ -41,8 +41,14 @@ def parse_options(argv=nil)
4141 opt . on ( '-o' , '--stdout FILE' , "Redirect stdout to logfile" ) { |c | opts [ :stdout ] = c }
4242 opt . on ( '-e' , '--stderr FILE' , "Redirect stderr to logfile" ) { |c | opts [ :stderr ] = c }
4343 opt . on ( '--nosync' , "Don't sync logfiles on every write" ) { opts [ :nosync ] = true }
44- opt . on ( "-p" , '--pidfile FILE' , "PID file location" ) { |c | opts [ :pidfile ] = c }
45- opt . on ( '--no-pidfile' , "Force no pidfile, even if daemonized" ) { opts [ :no_pidfile ] = true }
44+ opt . on ( "-p" , '--pidfile FILE' , "PID file location" ) { |c |
45+ opts [ :pidfile ] = c
46+ opts [ :no_pidfile ] = false
47+ }
48+ opt . on ( '--no-pidfile' , "Force no pidfile, even if daemonized" ) {
49+ opts [ :pidfile ] = nil
50+ opts [ :no_pidfile ] = true
51+ }
4652 opt . on ( '-l' , '--lock FILE' "Open a shared lock on a file" ) { |c | opts [ :lock_file ] = c }
4753 opt . on ( "-E" , '--environment ENVIRONMENT' , "Set RAILS_ENV/RACK_ENV/RESQUE_ENV" ) { |c | opts [ :environment ] = c }
4854 opt . on ( "-s" , '--spawn-delay MS' , Integer , "Delay in milliseconds between spawning missing workers" ) { |c | opts [ :spawn_delay ] = c }
@@ -54,9 +60,6 @@ def parse_options(argv=nil)
5460 opt . on ( "-v" , "--version" , "Show Version" ) { puts "resque-pool #{ VERSION } (c) nicholas a. evans" ; exit }
5561 end
5662 parser . parse! ( argv || parser . default_argv )
57- if opts [ :pidfile ]
58- opts . delete ( :no_pidfile )
59- end
6063 if opts [ :daemon ]
6164 opts [ :stdout ] ||= "log/resque-pool.stdout.log"
6265 opts [ :stderr ] ||= "log/resque-pool.stderr.log"
0 commit comments