Fix arg order

This commit is contained in:
kojix2 2020-10-11 00:11:54 +09:00
parent ba105ab1f3
commit 7e8dc6190c

View File

@ -32,46 +32,46 @@ module Uplot
opt.on('-o', '--output VAL', 'file to output results to [stderr]') do |v| opt.on('-o', '--output VAL', 'file to output results to [stderr]') do |v|
@output = v @output = v
end end
opt.on('-d', '--delimiter VAL', 'use DELIM instead of TAB for field delimiter', String) do |v| opt.on('-d', '--delimiter VAL', String, 'use DELIM instead of TAB for field delimiter') do |v|
@delimiter = v @delimiter = v
end end
opt.on('-H', '--headers', 'specify that the input has header row', TrueClass) do |v| opt.on('-H', '--headers', TrueClass, 'specify that the input has header row') do |v|
@headers = v @headers = v
end end
opt.on('-T', '--transpose', TrueClass) do |v| opt.on('-T', '--transpose', TrueClass) do |v|
@transpose = v @transpose = v
end end
opt.on('-t', '--title VAL', 'print string on the top of plot', String) do |v| opt.on('-t', '--title VAL', String, 'print string on the top of plot') do |v|
params.title = v params.title = v
end end
opt.on('-x', '--xlabel VAL', 'print string on the bottom of the plot', String) do |v| opt.on('-x', '--xlabel VAL', String, 'print string on the bottom of the plot') do |v|
params.xlabel = v params.xlabel = v
end end
opt.on('-y', '--ylabel VAL', 'print string on the far left of the plot', String) do |v| opt.on('-y', '--ylabel VAL', String, 'print string on the far left of the plot') do |v|
params.ylabel = v params.ylabel = v
end end
opt.on('-w', '--width VAL', 'number of characters per row', Integer) do |v| opt.on('-w', '--width VAL', Integer, 'number of characters per row') do |v|
params.width = v params.width = v
end end
opt.on('-h', '--height VAL', 'number of rows', Numeric) do |v| opt.on('-h', '--height VAL', Numeric, 'number of rows') do |v|
params.height = v params.height = v
end end
opt.on('-b', '--border VAL', 'specify the style of the bounding box', String) do |v| opt.on('-b', '--border VAL', String, 'specify the style of the bounding box') do |v|
params.border = v.to_sym params.border = v.to_sym
end end
opt.on('-m', '--margin VAL', 'number of spaces to the left of the plot', Numeric) do |v| opt.on('-m', '--margin VAL', Numeric, 'number of spaces to the left of the plot') do |v|
params.margin = v params.margin = v
end end
opt.on('-p', '--padding VAL', 'space of the left and right of the plot', Numeric) do |v| opt.on('-p', '--padding VAL', Numeric, 'space of the left and right of the plot') do |v|
params.padding = v params.padding = v
end end
opt.on('-c', '--color VAL', 'color of the drawing', String) do |v| opt.on('-c', '--color VAL', String, 'color of the drawing') do |v|
params.color = v =~ /\A[0-9]+\z/ ? v.to_i : v.to_sym params.color = v =~ /\A[0-9]+\z/ ? v.to_i : v.to_sym
end end
opt.on('--[no-]labels', 'hide the labels', TrueClass) do |v| opt.on('--[no-]labels', TrueClass, 'hide the labels') do |v|
params.labels = v params.labels = v
end end
opt.on('--fmt VAL', 'xyxy : header is like x1, y1, x2, y2, x3, y3...', 'xyy : header is like x, y1, y2, y2, y3...', String) do |v| opt.on('--fmt VAL', String, 'xyxy : header is like x1, y1, x2, y2, x3, y3...', 'xyy : header is like x, y1, y2, y2, y3...') do |v|
@fmt = v @fmt = v
end end
opt.on('--debug', TrueClass) do |v| opt.on('--debug', TrueClass) do |v|