From 21c65d5aea835917f92aa067e6d2cb2ddf87776d Mon Sep 17 00:00:00 2001 From: Swapnil Date: Wed, 25 Feb 2015 17:23:37 +0530 Subject: [PATCH] refs [#524] making --silent argument customisable --- bin/whenever | 3 +++ lib/whenever/setup.rb | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/whenever b/bin/whenever index 70a5bff6..7e02cd8c 100755 --- a/bin/whenever +++ b/bin/whenever @@ -36,6 +36,9 @@ OptionParser.new do |opts| options[:roles] = roles.split(',').map(&:to_sym) if roles end opts.on('-v', '--version') { puts "Whenever v#{Whenever::VERSION}"; exit(0) } + opts.on('-V', '--verbose', 'Not to run jobs in silence mode') do |mode| + options[:verbose] = true + end end.parse! Whenever::CommandLine.execute(options) diff --git a/lib/whenever/setup.rb b/lib/whenever/setup.rb index e2a02c41..1258545a 100644 --- a/lib/whenever/setup.rb +++ b/lib/whenever/setup.rb @@ -19,8 +19,9 @@ end set :bundle_command, Whenever.bundler? ? "bundle exec" : "" +set :verbose_mode, options[:verbose] ? '' : "--silent" job_type :command, ":task :output" -job_type :rake, "cd :path && :environment_variable=:environment :bundle_command rake :task --silent :output" +job_type :rake, "cd :path && :environment_variable=:environment :bundle_command rake :task :verbose_mode :output" job_type :script, "cd :path && :environment_variable=:environment :bundle_command script/:task :output" job_type :runner, "cd :path && :runner_command -e :environment ':task' :output"