From f7ddfdebe3c7cd67caa6211a034c8464f2bb2c96 Mon Sep 17 00:00:00 2001 From: Brendan McDevitt Date: Fri, 23 Mar 2018 19:48:27 -0500 Subject: [PATCH] just messing around with different ways to parse the arguments --- dump_csv.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dump_csv.rb b/dump_csv.rb index ebca958..c75485e 100755 --- a/dump_csv.rb +++ b/dump_csv.rb @@ -12,18 +12,18 @@ parser = OptionParser.new do |parser| parser.on("-c", "--column int", "The column number to dump.") do |column| options[:column] = column end - parser.on("-f", "--filename NAME", "The CSV filename to use.") do |filename| + parser.on("-f", "--filename FILE", "The CSV filename to use.") do |filename| options[:filename] = filename end + options[:all] = false parser.on("-a", "--all", "Dump all columns") do - options[:all] = truejj + options[:all] = true end end parser.parse! -#if options[:column].is_a? col_data = [] -CSV.foreach(options[:filename]) {|col| col_data << col[options[:column].to_i]} + +CSV.foreach (options[:filename]) {|col| col_data << col[options[:column].to_i]} if (options[:column] and options[:filename]) puts col_data -#end