goog 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/goog +7 -5
- data/lib/goog.rb +1 -1
- metadata +1 -1
data/bin/goog
CHANGED
@@ -158,13 +158,15 @@ if options[:less]
|
|
158
158
|
$stdout = STDOUT
|
159
159
|
loop {
|
160
160
|
puts File.read($tempfile.path)
|
161
|
-
print "Show result number: "
|
162
|
-
|
163
|
-
if
|
161
|
+
print "Show result number (may add pipe or redirect after, like `> file.txt`. `| less` is default): "
|
162
|
+
s = STDIN.gets
|
163
|
+
if s !~ /\d/
|
164
164
|
exit
|
165
165
|
end
|
166
|
-
n =
|
167
|
-
|
166
|
+
n = s[/\d+/,0].to_i
|
167
|
+
pipe = s[/[|>].*$/,0] || '| less'
|
168
|
+
cmd = "elinks -dump -no-numbering '#{links[n - 1]}' #{pipe}"
|
169
|
+
system cmd
|
168
170
|
}
|
169
171
|
end
|
170
172
|
|
data/lib/goog.rb
CHANGED