From c4d31108bbbbae864d3cb1b1a85b0edd2b3753c5 Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Sun, 16 Aug 2020 13:34:41 +0900 Subject: [PATCH] Improved error messages2 --- lib/uplot/plot.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/uplot/plot.rb b/lib/uplot/plot.rb index a740cb9..7743f63 100644 --- a/lib/uplot/plot.rb +++ b/lib/uplot/plot.rb @@ -128,10 +128,18 @@ module Uplot if series.size == 1 warn "uplot: There is only one series of input data. Please check the delimiter." warn "" + warn " Headers: \e[35m#{data.headers.inspect}\e[0m" warn " The first item is: \e[35m\"#{series[0][0]}\"\e[0m" warn " The last item is : \e[35m\"#{series[0][-1]}\"\e[0m" exit 1 end + if fmt == 'xyxy' && series.size.odd? + warn "uplot: In the xyxy format, the number of series must be even." + warn "" + warn " Number of series: \e[35m#{series.size}\e[0m" + warn " Headers: \e[35m#{data.headers.inspect}\e[0m" + exit 1 + end end end end