From 68acbb9a0c7967cb90a7e3756fc94fdd8a73d154 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Wed, 29 Jan 2014 19:14:08 +0100 Subject: make use of nlp_ruby, LICENSE --- splitpipes | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'splitpipes') diff --git a/splitpipes b/splitpipes index b0c3c9c..35ee176 100755 --- a/splitpipes +++ b/splitpipes @@ -2,24 +2,19 @@ require 'trollop' - STDIN.set_encoding 'utf-8' STDOUT.set_encoding 'utf-8' -def usage - STDERR.write "splitpipes -f < \n" - exit 1 -end -usage if ARGV.size!=2 -opts = Trollop::options do +cfg = Trollop::options do + banner "splitpipes -f < " opt :field, "field", :type => :int end while line = STDIN.gets j = 1 line.strip.split(' ||| ').each { |i| - if j == opts[:field] + if j == cfg[:field] puts i.strip break end -- cgit v1.2.3