diff --git a/lib/youplot/command.rb b/lib/youplot/command.rb index a7d090c..ac4c281 100644 --- a/lib/youplot/command.rb +++ b/lib/youplot/command.rb @@ -178,9 +178,9 @@ module YouPlot @backend.barplot(data, params, count: true, reverse: options[:reverse]) when :hist, :histogram @backend.histogram(data, params) - when :line, :lineplot + when :line, :lineplot, :l @backend.line(data, params, options[:fmt]) - when :lines, :lineplots + when :lines, :lineplots, :ls @backend.lines(data, params, options[:fmt]) when :scatter, :s @backend.scatter(data, params, options[:fmt]) diff --git a/lib/youplot/parser.rb b/lib/youplot/parser.rb index 26415d0..ebcd452 100644 --- a/lib/youplot/parser.rb +++ b/lib/youplot/parser.rb @@ -291,14 +291,14 @@ module YouPlot params.nbins = v end - when :lineplot, :line + when :lineplot, :line, :l sub_parser_add_canvas sub_parser_add_grid sub_parser_add_fmt_yx sub_parser_add_ylim sub_parser_add_xlim - when :lineplots, :lines + when :lineplots, :lines, :ls sub_parser_add_canvas sub_parser_add_grid sub_parser_add_fmt_xyxy diff --git a/test/youplot/iris_test.rb b/test/youplot/iris_test.rb index 4246d99..b5b2170 100644 --- a/test/youplot/iris_test.rb +++ b/test/youplot/iris_test.rb @@ -69,6 +69,12 @@ class YouPlotIRISTest < Test::Unit::TestCase assert_equal fixture('iris-lineplot.txt'), @stderr_file.read end + # l is an undocumented alias of lineplot. + test :l do + YouPlot::Command.new(['l', '-H', '-d,', '-t', 'IRIS-LINEPLOT']).run + assert_equal fixture('iris-lineplot.txt'), @stderr_file.read + end + test :lineplots do YouPlot::Command.new(['lineplots', '-H', '-d,', '-t', 'IRIS-LINEPLOTS']).run assert_equal fixture('iris-lineplots.txt'), @stderr_file.read @@ -79,6 +85,12 @@ class YouPlotIRISTest < Test::Unit::TestCase assert_equal fixture('iris-lineplots.txt'), @stderr_file.read end + # ls is an undocumented alias of lineplots. + test :ls do + YouPlot::Command.new(['lines', '-H', '-d,', '-t', 'IRIS-LINEPLOTS']).run + assert_equal fixture('iris-lineplots.txt'), @stderr_file.read + end + test :scatter do YouPlot::Command.new(['scatter', '-H', '-d,', '-t', 'IRIS-SCATTER']).run assert_equal fixture('iris-scatter.txt'), @stderr_file.read