Improved help message of sub parsers

This commit is contained in:
kojix2 2020-09-16 23:50:24 +09:00
parent 7020785818
commit 522a111aa9

View File

@ -81,7 +81,15 @@ module Uplot
end end
def create_sub_parsers def create_sub_parsers
parsers = Hash.new { |h, k| h[k] = create_default_parser } parsers = Hash.new do |h, k|
h[k] = create_default_parser do |parser|
parser.banner = <<~MSG
Usage: uplot #{k} [options]
Options:
MSG
end
end
parsers[:barplot] = \ parsers[:barplot] = \
parsers[:bar] parsers[:bar]
@ -187,7 +195,8 @@ module Uplot
Usage: uplot <command> [options] Usage: uplot <command> [options]
Command: #{sub_parsers.keys.join(' ')} Command:
#{sub_parsers.keys.join("\n ")}
Options: Options:
MSG MSG