From 097b1388b3cdabb8598abebd9d612bb4a1081fe6 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 29 Sep 2015 06:53:15 +0100 Subject: add debug switch --- rubyfy.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/rubyfy.rb b/rubyfy.rb index 3144a6a..2199249 100755 --- a/rubyfy.rb +++ b/rubyfy.rb @@ -54,22 +54,18 @@ end begin opts = GetoptLong.new( [ "--command", "-c", GetoptLong::REQUIRED_ARGUMENT ], + [ "--debug", "-d", GetoptLong::OPTIONAL_ARGUMENT ], [ "--parallel", "-p", GetoptLong::OPTIONAL_ARGUMENT ], + [ "--root", "-r", GetoptLong::OPTIONAL_ARGUMENT ], [ "--silent", "-s", GetoptLong::OPTIONAL_ARGUMENT ], [ "--verbose", "-v", GetoptLong::OPTIONAL_ARGUMENT ], - [ "--debug", "-d", GetoptLong::OPTIONAL_ARGUMENT ], - [ "--root", "-r", GetoptLong::OPTIONAL_ARGUMENT ], ) opts.each do |opt, arg| $ARGS[opt] = arg end - if $ARGS["--debug"] - opts.each do |opt, arg| - puts "#{opt} #{arg}" - end - end + log(:DEBUG, $ARGS) if $ARGS["--debug"] servers, jobs = [], [] STDIN.read.split("\n").each { |s| servers << s } -- cgit v1.2.3