mirror of
https://github.com/red-data-tools/YouPlot.git
synced 2025-05-06 07:10:10 +08:00
Add debug option
This commit is contained in:
parent
41a540c876
commit
1dce48cd2c
@ -11,6 +11,7 @@ module Uplot
|
|||||||
@transpose = false
|
@transpose = false
|
||||||
@output = false
|
@output = false
|
||||||
@count = false
|
@count = false
|
||||||
|
@debug = false
|
||||||
parse_options(argv)
|
parse_options(argv)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -27,6 +28,7 @@ module Uplot
|
|||||||
opt.on('-m', '--margin VAL', Numeric) { |v| @params[:margin] = v }
|
opt.on('-m', '--margin VAL', Numeric) { |v| @params[:margin] = v }
|
||||||
opt.on('-p', '--padding VAL', Numeric) { |v| @params[:padding] = v }
|
opt.on('-p', '--padding VAL', Numeric) { |v| @params[:padding] = v }
|
||||||
opt.on('-l', '--labels', TrueClass) { |v| @params[:labels] = v }
|
opt.on('-l', '--labels', TrueClass) { |v| @params[:labels] = v }
|
||||||
|
opt.on('--debug', TrueClass){ |v| @debug = v }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -72,6 +74,7 @@ module Uplot
|
|||||||
while input = Kernel.gets(nil)
|
while input = Kernel.gets(nil)
|
||||||
input.freeze
|
input.freeze
|
||||||
data, headers = preprocess(input)
|
data, headers = preprocess(input)
|
||||||
|
pp data: data, headers: headers if @debug
|
||||||
case @ptype
|
case @ptype
|
||||||
when 'hist', 'histogram'
|
when 'hist', 'histogram'
|
||||||
histogram(data, headers)
|
histogram(data, headers)
|
||||||
|
Loading…
Reference in New Issue
Block a user