mirror of
https://github.com/red-data-tools/YouPlot.git
synced 2025-05-07 07:31:12 +08:00
Make help error messages friendly
This commit is contained in:
parent
7c0ab3ebdb
commit
76d3f46549
@ -44,13 +44,19 @@ module Uplot
|
|||||||
parsers.default = nil
|
parsers.default = nil
|
||||||
|
|
||||||
main_parser.banner = <<~MSG
|
main_parser.banner = <<~MSG
|
||||||
Usage:\tuplot <command> [options]
|
Program: Uplot (Tools for plotting on the terminal)
|
||||||
Command:\t#{parsers.keys.join(' ')}
|
Version: #{Uplot::VERSION} (using unicode_plot #{UnicodePlot::VERSION})
|
||||||
|
|
||||||
|
Usage: uplot <command> [options]
|
||||||
|
|
||||||
|
Command: #{parsers.keys.join(' ')}
|
||||||
|
|
||||||
MSG
|
MSG
|
||||||
main_parser.order!(argv)
|
main_parser.order!(argv)
|
||||||
@ptype = argv.shift
|
@ptype = argv.shift
|
||||||
|
|
||||||
unless parsers.has_key?(@ptype)
|
unless parsers.has_key?(@ptype)
|
||||||
|
puts main_parser.help
|
||||||
warn "unrecognized command '#{@ptype}'"
|
warn "unrecognized command '#{@ptype}'"
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user