mongodb: -f synonym for --config in mongod wrapper

mongodb also ignores spaces at the beginning but not at the end
of a command line argument: ' --config' and '--config' are
equivalent, but '--config ' is an invalid option.

Closes Homebrew/homebrew#19509.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
Justin de Vesine 2013-04-29 09:30:38 -06:00 committed by Adam Vandenberg
parent ef268189ce
commit cd7a5c2c46

View file

@ -24,7 +24,9 @@ class Mongodb < Formula
mv bin/'mongod', prefix
(bin/'mongod').write <<-EOS.undent
#!/usr/bin/env ruby
ARGV << '--config' << '#{etc}/mongod.conf' unless ARGV.find { |arg| arg =~ /\-\-config/ }
ARGV << '--config' << '#{etc}/mongod.conf' unless ARGV.find { |arg|
arg =~ /^\s*\-\-config$/ or arg =~ /^\s*\-f$/
}
exec "#{prefix}/mongod", *ARGV
EOS