Added description of command line options

This commit is contained in:
kojix2 2020-09-16 23:14:20 +09:00
parent c25d47d721
commit 7020785818

View File

@ -28,49 +28,49 @@ module Uplot
OptionParser.new do |opt| OptionParser.new do |opt|
opt.program_name = 'uplot' opt.program_name = 'uplot'
opt.version = Uplot::VERSION opt.version = Uplot::VERSION
opt.on('-o', '--output', TrueClass) do |v| opt.on('-O', '--output', TrueClass) do |v|
@output = v @output = v
end end
.on('-d', '--delimiter VAL', String) do |v| .on('-d', '--delimiter VAL', 'Use DELIM instead of TAB for field delimiter.', String) do |v|
@delimiter = v @delimiter = v
end end
.on('-H', '--headers', TrueClass) do |v| .on('-H', '--headers', 'Specify that the input has header row.', TrueClass) do |v|
@headers = v @headers = v
end end
.on('-T', '--transpose', TrueClass) do |v| .on('-T', '--transpose', TrueClass) do |v|
@transpose = v @transpose = v
end end
.on('-t', '--title VAL', String) do |v| .on('-t', '--title VAL', 'Title for the plot', String) do |v|
params.title = v params.title = v
end end
.on('-w', '--width VAL', Numeric) do |v| .on('-x', '--xlabel VAL', 'The string to display on the bottom of the plot', String) do |v|
params.width = v
end
.on('-h', '--height VAL', Numeric) do |v|
params.height = v
end
.on('-b', '--border VAL', Numeric) do |v|
params.border = v
end
.on('-m', '--margin VAL', Numeric) do |v|
params.margin = v
end
.on('-p', '--padding VAL', Numeric) do |v|
params.padding = v
end
.on('-c', '--color VAL', String) do |v|
params.color = v =~ /\A[0-9]+\z/ ? v.to_i : v.to_sym
end
.on('-x', '--xlabel VAL', String) do |v|
params.xlabel = v params.xlabel = v
end end
.on('-y', '--ylabel VAL', String) do |v| .on('-y', '--ylabel VAL', 'The string to display on the far left of the plot.', String) do |v|
params.ylabel = v params.ylabel = v
end end
.on('-l', '--labels', TrueClass) do |v| .on('-w', '--width VAL', 'Number of characters per row.', Integer) do |v|
params.width = v
end
.on('-h', '--height VAL', 'Number of rows.', Numeric) do |v|
params.height = v
end
.on('-b', '--border VAL', 'The style of the bounding box of the plot.', String) do |v|
params.border = v.to_sym
end
.on('-m', '--margin VAL', 'Number of empty characters to the left of the plot.', Numeric) do |v|
params.margin = v
end
.on('-p', '--padding VAL', 'Space of the left and right of the plot.', Numeric) do |v|
params.padding = v
end
.on('-c', '--color VAL', 'Color of the drawing.', String) do |v|
params.color = v =~ /\A[0-9]+\z/ ? v.to_i : v.to_sym
end
.on('--[no-]labels', 'Hide the labels', TrueClass) do |v|
params.labels = v params.labels = v
end end
.on('--fmt VAL', String) do |v| .on('--fmt VAL', 'xyy, xyxy', String) do |v|
@fmt = v @fmt = v
end end
.on('--debug', TrueClass) do |v| .on('--debug', TrueClass) do |v|