summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <rubyfy@dev.buetow.org>2015-09-29 06:53:15 +0100
committerPaul Buetow <rubyfy@dev.buetow.org>2015-09-29 06:53:15 +0100
commit097b1388b3cdabb8598abebd9d612bb4a1081fe6 (patch)
treedbff4eb05bde1234ab3228fc5bdb286086eab0f5
parenta1ec74869e715b2fa19dd4820f24df1a832365e3 (diff)
add debug switch
-rwxr-xr-xrubyfy.rb10
1 files 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 }