ad default code, Jruby sucks

This commit is contained in:
Elan Meng 2009-11-19 13:16:47 +08:00 committed by Javan Makhmali
parent cc2993f1be
commit 4458855364
2 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ options = Hash.new
OptionParser.new do |opts| OptionParser.new do |opts|
opts.banner = "Usage: whenever [options]" opts.banner = "Usage: whenever [options]"
opts.on('-v', '--version') { puts "Whenever v#{Whenever::VERSION}"; exit } opts.on('-v', '--version') { puts "Whenever v#{Whenever::VERSION}"; exit(0) }
opts.on('-w', '--write-crontab') { options[:write] = true } opts.on('-w', '--write-crontab') { options[:write] = true }
opts.on('-i', '--update-crontab [identifier]', 'Default: full path to schedule.rb file') do |identifier| opts.on('-i', '--update-crontab [identifier]', 'Default: full path to schedule.rb file') do |identifier|
options[:update] = true options[:update] = true

View File

@ -29,7 +29,7 @@ module Whenever
write_crontab(whenever_cron) write_crontab(whenever_cron)
else else
puts Whenever.cron(@options) puts Whenever.cron(@options)
exit exit(0)
end end
end end
@ -67,7 +67,7 @@ module Whenever
action = 'written' if @options[:write] action = 'written' if @options[:write]
action = 'updated' if @options[:update] action = 'updated' if @options[:update]
puts "[write] crontab file #{action}" puts "[write] crontab file #{action}"
exit exit(0)
else else
warn "[fail] Couldn't write crontab; try running `whenever' with no options to ensure your schedule file is valid." warn "[fail] Couldn't write crontab; try running `whenever' with no options to ensure your schedule file is valid."
exit(1) exit(1)