From 8151031373c08ccd714a99f50783eafcb54d2010 Mon Sep 17 00:00:00 2001
From: Patrick Simianer
Date: Wed, 10 Jun 2015 14:48:34 +0200
Subject: undo unfortunate variable naming: cfg -> conf!
---
split_pipes | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
(limited to 'split_pipes')
diff --git a/split_pipes b/split_pipes
index a1a0128..ce8f018 100755
--- a/split_pipes
+++ b/split_pipes
@@ -5,7 +5,7 @@ require 'trollop'
STDIN.set_encoding 'utf-8'
STDOUT.set_encoding 'utf-8'
-cfg = Trollop::options do
+conf = Trollop::options do
banner "splitpipes -f < "
opt :field, "field", :type => :int, :required => true
opt :to, "to", :type => :int, :default => nil
@@ -14,18 +14,18 @@ end
a = []
range = false
-if cfg[:to]
+if conf[:to]
range = true
end
if range
- if cfg[:field] >= cfg[:to]
+ if conf[:field] >= conf[:to]
STDERR.write "field >= to, exiting\n"
exit
end
end
-if cfg[:field]<=0 || (range && cfg[:to]<=0)
+if conf[:field]<=0 || (range && conf[:to]<=0)
STDERR.write "field or to <= 0, exiting"
exit
end
@@ -33,9 +33,9 @@ end
while line = STDIN.gets
j = 1
line.strip.split(' ||| ').each { |i|
- if range && (cfg[:field]..cfg[:to]).include?(j)
+ if range && (conf[:field]..conf[:to]).include?(j)
a << i.strip
- elsif j == cfg[:field]
+ elsif j == conf[:field]
puts i.strip
break
end
--
cgit v1.2.3