bin/deputy in deputy-0.1.47 vs bin/deputy in deputy-0.1.48

- old
+ new

@@ -18,22 +18,25 @@ BANNER opts.on("-h", "--help","Show this.") { puts opts; exit } opts.on('-v', '--version','Show Version'){ puts Deputy::VERSION; exit} opts.on('--install-cron','Install crontask'){ Deputy.install_cron; exit} + opts.on('--no-wait','Do not wait before executing plugins'){ options[:no_wait] = true } opts.on('--run-plugins','Run all plugins for this minute (belongs into crontask)') do - puts Time.now.strftime("%Y-%m-%d %H:%M:%S") - Deputy.run_plugins - exit + options[:run_plugins] = true end opts.on('--host x', 'Use this host, when reporting') do |host| options[:host] = host end end.parse! - -metric, value = ARGV[0..1] -if metric.to_s.empty? - puts "Usage instructions: deputy --help" - exit -end -Deputy.send_report metric, (value || Deputy::DEFAULT_VALUE), options \ No newline at end of file +if options[:run_plugins] + puts Time.now.strftime("%Y-%m-%d %H:%M:%S") + Deputy.run_plugins options +else + metric, value = ARGV[0..1] + if metric.to_s.empty? + puts "Usage instructions: deputy --help" + exit + end + Deputy.send_report metric, (value || Deputy::DEFAULT_VALUE), options +end