Skip to content
Browse files

bin/socksify_ruby invokes irb when called without a script argument

  • Loading branch information...
1 parent 30820e4 commit 8d4653cd9d9d87bb10f8120e4e7c0dd75a84a1ac @ChristopherThorpe ChristopherThorpe committed with Dec 14, 2010
Showing with 9 additions and 3 deletions.
  1. +9 −3 bin/socksify_ruby
View
12 bin/socksify_ruby
@@ -1,12 +1,18 @@
#!/usr/bin/env ruby
-if ARGV.size < 3
- puts "Usage: #{$0} <SOCKS host> <SOCKS port> <ruby script> [args ...]"
+if ARGV.size < 2
+ puts "Usage: #{$0} <SOCKS host> <SOCKS port> [script args ...]"
exit
end
require 'socksify'
TCPSocket.socks_server = ARGV.shift
TCPSocket.socks_port = ARGV.shift.to_i
-load ARGV.shift
+if ARGV.size >= 1
+ load ARGV.shift
+else
+ require 'irb'
+ IRB.start(__FILE__)
+end
+

0 comments on commit 8d4653c

Please sign in to comment.
Something went wrong with that request. Please try again.