unpack: use ARGV.value

This commit is contained in:
Jack Nagel 2013-08-14 20:11:40 -05:00
parent c4b278dfce
commit 262afced5e

View File

@ -66,11 +66,10 @@ changes.
formulae = ARGV.formulae
raise FormulaUnspecifiedError if formulae.empty?
unpack_dir = ARGV.options_only.select {|o| o.start_with? "--destdir="}
if unpack_dir.empty?
unpack_dir = Pathname.new Dir.getwd
if (dir = ARGV.value('destdir')).nil?
unpack_dir = Pathname.pwd
else
unpack_dir = Pathname.new(unpack_dir.first.split('=')[1]).realpath
unpack_dir = Pathname.new(dir).realpath
unpack_dir.mkpath unless unpack_dir.exist?
end