Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bin/csv-filter
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ Usage: #{parser.program_name} [options]
and writes that text to the standard output.
BANNER


parser.on('--input-col-sep=SEPARATOR',
'Input column separator string.') do |value|
options[:input_col_sep] = value
end

begin
parser.parse!
rescue OptionParser::InvalidOption
Expand Down
6 changes: 6 additions & 0 deletions test/csv/test_csv_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,10 @@ def test_option_v
assert_equal(["csv-filter #{CSV::VERSION}\n", ""],
run_csv_filter("", "-v"))
end

def test_option_input_col_sep
csv = "aaa:bbb:ccc\nddd:eee:fff\n"
assert_equal(["aaa,bbb,ccc\nddd,eee,fff\n", ""],
run_csv_filter(csv, "--input-col-sep=:"))
end
end
Loading