Skip to content

Commit e995ccf

Browse files
committed
make this a little easier to read
1 parent e26fb49 commit e995ccf

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lib/rex/ui/text/shell.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,17 +192,19 @@ def run(&block)
192192

193193
# If a block was passed in, pass the line to it. If it returns true,
194194
# break out of the shell loop.
195-
if (block)
196-
break if (line == nil or block.call(line))
197-
elsif(input.eof? or line == nil)
198-
# If you have sessions active, this will give you a shot to exit gracefully
199-
# If you really are ambitious, 2 eofs will kick this out
195+
if block
196+
break if line == nil || block.call(line)
197+
198+
# If you have sessions active, this will give you a shot to exit
199+
# gracefully. If you really are ambitious, 2 eofs will kick this out
200+
elsif input.eof? || line == nil
200201
self.stop_count += 1
201-
next if(self.stop_count > 1)
202+
next if self.stop_count > 1
202203
run_single("quit")
203-
else
204+
204205
# Otherwise, call what should be an overriden instance method to
205206
# process the line.
207+
else
206208
ret = run_single(line)
207209
# don't bother saving lines that couldn't be found as a
208210
# command, create the file if it doesn't exist

0 commit comments

Comments
 (0)