diff --git a/bin/csv-filter b/bin/csv-filter index c5328171..bfa26e12 100755 --- a/bin/csv-filter +++ b/bin/csv-filter @@ -22,6 +22,11 @@ parser.on('--input-col-sep=SEPARATOR', options[:input_col_sep] = value end +parser.on('--input-row-sep=SEPARATOR', + 'Input row separator string.') do |value| + options[:input_row_sep] = value +end + begin parser.parse! rescue OptionParser::InvalidOption diff --git a/test/csv/test_csv_filter.rb b/test/csv/test_csv_filter.rb index 01e39071..95b82dbe 100644 --- a/test/csv/test_csv_filter.rb +++ b/test/csv/test_csv_filter.rb @@ -77,4 +77,10 @@ def test_option_input_col_sep assert_equal(["aaa,bbb,ccc\nddd,eee,fff\n", ""], run_csv_filter(csv, "--input-col-sep=:")) end + + def test_option_input_row_sep + csv = "aaa,bbb,ccc:ddd,eee,fff:" + assert_equal(["aaa,bbb,ccc\nddd,eee,fff\n", ""], + run_csv_filter(csv, "--input-row-sep=:")) + end end