bin/*: enforce -p/--port argument to be a valid integer
commitd5870ccc714a4bb442a46aedd4c68c547e8e56f4
authorEric Wong <e@80x24.org>
Fri, 1 Nov 2013 20:02:47 +0000 (1 20:02 +0000)
committerEric Wong <normalperson@yhbt.net>
Fri, 1 Nov 2013 20:05:19 +0000 (1 20:05 +0000)
tree7575e2aacb8816bc911b454c8662e6dd6162bd79
parent7e9e4c740aba24096f768f578779dc1053cb8b70
bin/*: enforce -p/--port argument to be a valid integer

Users may confuse '-p' with the (to-be-deprecated) '-P/--pid'
option, leading to surprising behavior if a pathname is passed as a
port, because String#to_i would convert it to zero, causing:

    TCPServer.new(host, port = 0)

to bind to a random, unused port.
bin/unicorn
bin/unicorn_rails