diff --git a/lib/uplot/command/parser.rb b/lib/uplot/command/parser.rb index f7fc2e8..8bbba89 100644 --- a/lib/uplot/command/parser.rb +++ b/lib/uplot/command/parser.rb @@ -81,6 +81,12 @@ module Uplot 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 end + # Optparse adds the help option, but it doesn't show up in usage. + # This is why you need the code below. + opt.on('--help', 'print sub-command help menu') do + puts opt.help + exit + end opt.on('--debug', TrueClass, 'print preprocessed data') do |v| @debug = v end