Commit a8c7e554 authored by Michael Witrant's avatar Michael Witrant

use global variable for debug

parent 08d2d3fb
......@@ -9,11 +9,20 @@ require 'erb'
require 'ostruct'
options = {}
def debug(values)
def debug(value)
if $DEBUG
case value
when String
output = value
else
output = value.inspect
end
STDERR.puts output
end
end
extra_args = cli '--xml-dump' => lambda { |path| options[:xml_dump_path] = path },
'-d --debug' => lambda { def debug(values) p values; end },
'-d --debug' => lambda { $DEBUG = true },
'-1 --one' => lambda { options[:parse_only_one] = true },
'-n --number' => lambda { |num| options[:parse_only_num] = num }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment