Skip to content

Commit

Permalink
Handle the old wait/nowait shift behavior.
Browse files Browse the repository at this point in the history
The old msfupdate would shift the first argument off the stack
regardless what it was. We have two possible candaidates now, wait and
nowait. Shouldn't be any others.

[SeeRM rapid7#7297]
  • Loading branch information
todb committed Oct 10, 2012
1 parent 9a0a063 commit f247379
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions msfupdate
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ end

@args.each_with_index do |arg,i|
case arg
when "wait"
# Handle the old wait/nowait argument behavior
when "wait", "nowait"
@wait_index = i
@actually_wait = (arg == "wait")
# Handle passing a config-dir especially
when /--config-dir/
# Spaces in the directory should be fine since this whole thing is passed
# as a single argument via the multi-arg syntax for system() below.
Expand All @@ -54,7 +57,7 @@ else
system("svn", "update", *@args)
end

if @wait_index
if @actually_wait
$stderr.puts ""
$stderr.puts "[*] Please hit enter to exit"
$stderr.puts ""
Expand Down

0 comments on commit f247379

Please sign in to comment.